PMDTask ClassNotFoundException with gradle
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Hello,
I am getting a ClassNotFoundException for net.sourceforge.pmd.ant.PMDTask when trying to create an ant task in gradle for the following line:
ant.taskdef(name: 'pmd', classname: 'net.sourceforge.pmd.ant.PMDTask')
This doesn't happen on 5.1.2
Please note, that with PMD 5.2.0 pmd has been modularized, so you'll need to add
net.sourceforge.pmd:pmd-coreas well as any language (e.g.net.sourceforge.pmd:pmd-java) in your dependencies list.Does the documentation here http://www.gradle.org/docs/current/userguide/ant.html#useExternalAntTaskWithConfig describe what you want to do?
Then it would be for pmd >= 5.2 the following example:
Does this work for you?
I think that this is a gradle issue, not a PMD one. It should be fixed with Gradle 2.4, which will probably contains this commit here:
https://github.com/gradle/gradle/commit/b07541e985b17d07f7141b19fd64a10e33c4a0bd
This seems to have been fixed with Gradle 2.4.