[MPMD-399] Incorrect warning: The project X does not seem to be compiled. PMD results might be inaccurate. (original) (raw)

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

and therefore no target/classes or target/test-classes directories 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

Reproduction example

Warning is reported

Possible fixes