GeezerVison is showing github.com — Add control of PMD execution threads to plugin goal by harrisric · Pull Request #700 · apache/maven-pmd-plugin
Conversation
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.
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.
|
@adangel what needs to happen for this to be reviewed and accepted?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
A test will be appreciated for it
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
harrisric
commented
Apr 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
@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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@slawekjaranowski any thoughts on the appropriate type of tests for this, so that we can complete this change?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
@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 😄
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
harrisric reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adangel
added a commit
that referenced
this pull request
Sep 12, 2026
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
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
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
Uh oh!
There was an error while loading. Please reload this page.
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.
|