[ 
https://issues.apache.org/jira/browse/MPMD-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17853698#comment-17853698
 ] 

Michael Osipov commented on MPMD-399:
-------------------------------------

I have a slight problem with {{includeTests}}: It documentation says "Run PMD 
on the tests.". Looking at 
https://github.com/apache/maven-pmd-plugin/blob/1961d771ea585e9344c25dfde194ee64a1b9040b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java#L351-L384.
 The operation is additive/inclusive. The description is wrong. But here, it is 
exclusive: 
https://github.com/apache/maven-pmd-plugin/blob/1961d771ea585e9344c25dfde194ee64a1b9040b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java#L516-L518

[~adangel], shouldn't {{auxClasspath}} include main classpath as well when 
tests should be included? Since dependencies are inclusive as well: 
https://github.com/apache/maven-pmd-plugin/blob/1961d771ea585e9344c25dfde194ee64a1b9040b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java#L493-L497

It does not compute fo me.

[~AB-xdev], sorry to deviate, but that needs to clarified first.

> Incorrect warning: The project X does not seem to be compiled. PMD results 
> might be inaccurate.
> -----------------------------------------------------------------------------------------------
>
>                 Key: MPMD-399
>                 URL: https://issues.apache.org/jira/browse/MPMD-399
>             Project: Maven PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.22.0
>            Reporter: AB-xdev
>            Priority: Major
>
> PMD plugin is reporting the following warnings on in a multi-maven project:
> "The project X does not seem to be compiled. PMD results might be inaccurate."
> This is caused by the fact that not all modules have a
>  * {{src/main/java}} or
>  * {{src/test/java}} folder
> and therefore no {{target/classes}} or {{target/test-classes}} folders are 
> generated.
> The affected code that causes the problem can be found here:
> [https://github.com/apache/maven-pmd-plugin/blob/1961d771ea585e9344c25dfde194ee64a1b9040b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java#L516-L532]
> h3. Reproduction example
>  * Create a maven multi-module project
>  * Leave {{src/main/java}} of one module empty
>  * Execute {{pmd:aggregate-pmd}} or {{test pmd:aggregate-pmd-no-fork 
> -DskipTests}}
> → (x) Warning is reported
> h3. Possible fixes
> * Make it possible to ignore this warning
> * Do not warn when at least {{target/classes}} or {{target/test-classes}} is 
> present
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to