[ http://jira.codehaus.org/browse/MPMD-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp closed MPMD-30. --------------------------- Resolution: Fixed I added an includeTests config item to have it include all the testSourceRoots when searching for files. > No way to PMD test the test sources in src/test/java > ---------------------------------------------------- > > Key: MPMD-30 > URL: http://jira.codehaus.org/browse/MPMD-30 > Project: Maven 2.x Pmd Plugin > Issue Type: Bug > Affects Versions: 2.0 > Reporter: Daniel Kulp > Assigned To: Daniel Kulp > Fix For: 2.2 > > > There currently isn't ANY way to have PMD check the test sources in > src/test/java. > For the checkstyle plugin, you can do something like: > <sourceDirectory>${basedir}/src</sourceDirectory> > which would allow it to check ALL the java files in src including the ones in > src/test/java. For PMD, however, the sourceDirectory field is readonly so > is not settable in the pom.xml. > Log of discussion on IRC: > [16:28:29] <kenney> pmd: // TODO: use source roots instead > [16:28:29] <kenney> String sourceDirectory = > project.getBuild().getSourceDirectory(); > [16:28:30] <kenney> :) > [16:28:43] <jdcasey> ugh > [16:28:49] <jdcasey> it's not even using an expression?? > [16:28:59] <kenney> nope > [16:29:08] <jdcasey> should be ${project.compileSourceRoots}, and not > @readonly > [16:29:24] <jdcasey> dkulp: only thing I can say is to fix the plugin and > deploy a snapshot... > [16:29:39] <dkulp> Or not pmd the tests for now. > [16:30:52] <kenney> btw, you don't want to always run source-checking stuff > on all sources > [16:31:07] <kenney> generated sources usually don't follow coding style for > instance > [16:31:30] <dkulp> Right. That's why i want "${basedir}/src" and not > "target/...." > [16:31:32] <kenney> so using compileSourceRoot is tricky.. > [16:31:49] <kenney> well you can do that for checkstyle and specify > includes/excludes > [16:31:58] <jdcasey> fair enough > [16:32:04] <dkulp> Right. checkstyle works OK. > [16:32:09] <jdcasey> but overriding that list should be enough, I would think > [16:32:26] <kenney> we should actually be able to mark sourceRoots as being > generated or not -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira