[ https://jira.codehaus.org/browse/MPMD-151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=300334#comment-300334 ]
Andreas Dangel commented on MPMD-151: ------------------------------------- I verified the code of PMD and we use indeed the canonical paths of the files. I was also able to verify this issue manually by adding the following constructor to PmdReportTest (sorry, couldn't find an easier way to reproduce this :)): {noformat} public PmdReportTest() throws Exception { Field field = PlexusTestCase.class.getDeclaredField( "basedirPath" ); field.setAccessible( true ); field.set( null, "/M_TEST/maven-pmd-plugin" ); } {noformat} whereby "M_TEST" is a symlink to my home directory (/home/andreas). Now run it, e.g. "mvn test". The attached patch solves this problem. > Use canonical paths for the file list / Unit test failures on > builds.apache.org > ------------------------------------------------------------------------------- > > Key: MPMD-151 > URL: https://jira.codehaus.org/browse/MPMD-151 > Project: Maven 2.x PMD Plugin > Issue Type: Improvement > Components: PMD > Affects Versions: 2.8 > Reporter: Andreas Dangel > Attachments: canonical-files.patch > > > On the CI server, some unit tests are failing for maven-pmd-plugin > (https://builds.apache.org/job/maven-plugins/). > It seems that the tests run fine on the slave "ubuntu2" but not on "ubuntu3". > ubuntu2 workspace path: > /home/hudson/hudson-slave/workspace/maven-plugins > ubuntu3 workspace path: > /home/jenkins/jenkins-slave/workspace/maven-plugins > However, PMD found violations in the following file: > /x1/jenkins/jenkins-slave/workspace/maven-plugins/maven-pmd-plugin/src/test/resources/unit/default-configuration/def/configuration/App.java > This could indicate the /x1 is actually a sym-link to /home. Maven-pmd-plugin > sees /home/... and PMD sees /x1/.... PMD reports violations against /x1 but > the maven-pmd-plugin doesn't know about this (it requested to process files > under /home) - so the internal PmdFileInfo object couldn't not be determined. > Assuming the above is correct, then the attached patch *could* solve this > problem. It determines the canonical paths of the files to be processed, > hoping that the filenames are unique then. However, I could not reproduce > this problem locally (I started maven from commandline instead letting > Jenkins start it, maybe that's the difference?). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira