GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add control of PMD execution threads to plugin goal by harrisric · Pull Request #700 · apache/maven-pmd-plugin

Conversation

@harrisric

@harrisric harrisric commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
  • In any other case, please file an Apache Individual Contributor License Agreement.

This change adds feature #380
Tested locally but I have not yet written any unit tests as I was not sure of the style/approach that would be considered suitable for this type of additional configuration. as it doesn't change the output of the analysis/report in anyway. It would be easy to separate the handling of the configuration and add tests for that if required.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@harrisric
Add control of PMD execution threads to plugin goal
c5b5bdc
@adangel adangel linked an issue Apr 7, 2026 that may be closed by this pull request
[MPMD-413] Add support for configuring the max number of threads to use #380
Closed
@harrisric

harrisric commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@adangel what needs to happen for this to be reviewed and accepted?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Apr 21, 2026

Copy link
Copy Markdown
Member

A test will be appreciated for it

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@harrisric

harrisric commented Apr 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@slawekjaranowski happy to do that, could you suggest where this would fit in the existing tests? As I noted above this doesn't change the output of the analysis / report in any way.
I could write a unit test which shows that the numThreadsConverter method works, particularly by separating it from the mojo (and possibly needing to further abstract away the use of Runtime.getRuntime().availableProcessors()).
Or I could write a test which shows that the value is propagated to the PMDConfiguration on the executor, but there are no existing tests like this.
Or I could write a further integration-test, though it would likely be a simple copy of an existing test with the new configuration. Also the variations using a multiple of the cores available are not really testable in this sense as we cannot control the cores available in the test environment.
Just want to make sure any tests I do add here provide some material value to the project.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@harrisric

harrisric commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

@slawekjaranowski any thoughts on the appropriate type of tests for this, so that we can complete this change?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski
slawekjaranowski self-requested a review May 21, 2026 11:02
slawekjaranowski
slawekjaranowski reviewed May 24, 2026
View reviewed changes
Comment thread src/main/java/org/apache/maven/plugins/pmd/PmdReport.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Jul 15, 2026

Copy link
Copy Markdown
Member

@harrisric

We can do a method static and package protected with next param

static Integer numThreadsConverter(String executionThreadsString, int availableProcessors) 

method can return null for executionThreadsString == null

it will be easy test by UT, with many cases, we can use a parameterized test

in production code it will be executed by:

numThreadsConverter(executionThreadsString, Runtime.getRuntime().availableProcessors()) 

apologies for delay response 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@harrisric
Make numThreadsConverter testable and add test coverage.
75872f3
@harrisric

harrisric commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

@slawekjaranowski apologies for the delay in return - I was on an extended break.
Suggested change made and tests now added.

slawekjaranowski reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slachiewicz slachiewicz added the enhancement New feature or request label Aug 24, 2026
@slawekjaranowski

slawekjaranowski commented Aug 24, 2026

Copy link
Copy Markdown
Member

@harrisric please apply mvn spotless:apply

harrisric reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@harrisric
Apply spotless
63f310f
slawekjaranowski
slawekjaranowski approved these changes Aug 24, 2026
View reviewed changes
@slawekjaranowski
slawekjaranowski merged commit 297d728 into apache:master Aug 24, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added this to the 3.28.1 milestone Aug 24, 2026
@github-actions github-actions Bot assigned slawekjaranowski Aug 24, 2026
@adangel adangel mentioned this pull request Sep 10, 2026
Planned releases — Q4 2026 (Doxia stack + plugins + shared deps) apache/maven#13085
Open
adangel added a commit that referenced this pull request Sep 12, 2026
@adangel
Set version to 3.29.0-SNAPSHOT
463acb9
Changes since 3.28.0 rule out a patch: Thread configuration (#700), Update PMD to 7.27.0 (#729), targetJdk/toolchain/type resolution (#726)
Aligns the pom with the existing 3.29.0 milestone.
@adangel adangel changed the title Add control of PMD execution threads to plugin goal Add control of PMD execution threads to plugin goal (fixes #380) Oct 28, 2026
@adangel adangel changed the title Add control of PMD execution threads to plugin goal (fixes #380) Add control of PMD execution threads to plugin goal Oct 28, 2026
@slachiewicz slachiewicz mentioned this pull request Nov 18, 2026
Link the CPD report and goal docs to docs.pmd-code.org #787
Merged
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slawekjaranowski slawekjaranowski slawekjaranowski approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@slawekjaranowski slawekjaranowski

Labels

enhancement New feature or request

Projects

None yet

Milestone

3.29.0

Development

Successfully merging this pull request may close these issues.

[MPMD-413] Add support for configuring the max number of threads to use

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@harrisric @slawekjaranowski @slachiewicz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.