We are using PMD to check an Android project. The pom file that "drives" the Android project uses android-maven-plugin (3.8.2).
Our android project depends on a number of 3rd party libraries. Some of these libraries are apklibs. The android-maven-plugin handles apklibs by expanding them into a given directory before compiling.
This results in a very long value being passed to maven-pmd in the compileSourceRoots variable. I understand you can't override compileSourceRoots so I turned to excludeRoots to exclude these 3rd parties libraries from analysis
The target directories that contain source in an maven Android project would look something like:
So you would hope that the maven-pmd plugin could be configured as
However this doesn't work. The excludeRoots get compared directly for equality in the contains clause of
in AbstractPmdReport.java. This obviously doesn't work as unpacked-libs is the container for a whole host of source directories.
I suggest that the comparison should look at the base path as
With the comparison line becoming
This is working in my test project and doesn't fail any of the maven-pmd unit tests.
I tried uploading an attachment with the changes described above but to no avail - not sure what is happening there.