You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jacob Robertson (JIRA)" <ji...@codehaus.org> on 2006/11/17 18:06:31 UTC

[jira] Commented: (MPMD-30) No way to PMD test the test sources in src/test/java

    [ http://jira.codehaus.org/browse/MPMD-30?page=comments#action_80420 ] 
            
Jacob Robertson commented on MPMD-30:
-------------------------------------

Checkstyle has this fix in their head right now that allows a simple flag to say "yes I also want to run checkstyle on my test classes".  The pom would look like

{code:xml}
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-checkstyle-plugin</artifactId>
	<configuration>
		<configLocation>http://mylocation/documents/architecture/checkstyle/checkstyle.xml</configLocation>
		<includeTestSourceDirectory>true</includeTestSourceDirectory>
	</configuration>
</plugin>
{code}

> 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
>
> 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