Open GoogleCodeExporter opened 9 years ago
After investigating, i've seen that if you specify no include in pmd
configuration,
you've got that line in the .pmdruleset.
<exclude-pattern>.*/home/projets/lmichenaud/workspace-android/testcheckstyle.*</
exclude-pattern>
This line is not present from my remote pmd configuration (comes from sonar).
This prevents pmd working.
I think this line should not be added or you want to keep it, you have to
add a default include to **\/*.java which is the default value of the "include"
parameter of maven pmd plugin.
Original comment by lmichen...@gmail.com
on 13 Oct 2010 at 12:12
I also see the behaviour lmichenaud reports. I don't get the PMD warnings I
should be getting, but once I clear the exclude-pattern in .pmdruleset it
starts working.
Original comment by mike...@gmail.com
on 22 Oct 2010 at 8:50
Looking a bit further, in my case it seems my PMD configuration isn't being
picked up at all and I am instead getting a default setup. I'm pointing PMD at
my common rule file like this:
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
...
<excludeRoots>
<excludeRoot>src/main/generated</excludeRoot>
<excludeRoot>src/test</excludeRoot>
<excludeRoot>src/integration-test</excludeRoot>
</excludeRoots>
<rulesets>
<ruleset>common/pmd-rules.xml</ruleset>
</rulesets>
...
</configuration>
...
</plugin>
and pmd-rules.xml contains:
<ruleset>
<exclude-pattern>.*/src/test/.*</exclude-pattern>
...
<!-- no inclusion of AvoidDuplicateLiterals -->
</ruleset>
The M2Eclipse log says:
[M2E-PMD]: Eclipse PMD Configuration STARTED
[M2E-PMD]: Successfully resolved artifact [org.apache.maven.plugins...]
[M2E-PMD]: Successfully resolved artifact [common...]
[M2E-PMD]: RESOLVED location <common/pmd-rules.xml> as [jar:file:.../common/pmd-rules.xml]
[M2E-PMD]: ADDED PMD nature and builder to the eclipse project
[M2E-PMD]: Eclipse PMD Configuration ENDED
Still, the generated .pmdruleset in the Eclipse project contains:
<ruleset ...>
<exclude-pattern>.*/my_project_dir.*</exclude-pattern>
...
<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>
</ruleset>
lmichenaud: Is this the same problem you are seeing, or should I log this as a
new ticket?
Original comment by mike...@gmail.com
on 22 Oct 2010 at 9:41
I think it is the same problem.
I have resolved the problems using that configuration :
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<includes>
<include>**\/*.java</include>
</includes>
<rulesets>
<ruleset>${pmd.ruleSet}</ruleset>
</rulesets>
</configuration>
</plugin>
Original comment by lmichen...@gmail.com
on 22 Oct 2010 at 9:47
What happens if you change something in your ruleset file (the file pointed to
by pmd.ruleSet). Is it reflected in the generated .pmdruleset file?
Original comment by mike...@gmail.com
on 22 Oct 2010 at 9:55
Hey guys,
I've just committed some fixes to the include/exclude rules for PMD/CS. If
you're building the plugins from source, can you update from tip and see if the
fixes solve the issues you're experiencing? You shouldn't need any hacks in
your PMD/CS configs.
Original comment by mr.id...@gmail.com
on 20 Dec 2010 at 5:31
I have not tested but i've got a question.
Did you make your plugin compatible with m2eclipse 0.12 ?
Original comment by lmichen...@gmail.com
on 21 Dec 2010 at 10:24
Original issue reported on code.google.com by
lmichen...@gmail.com
on 5 Oct 2010 at 12:55