Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-151

Use canonical paths for the file list / Unit test failures on builds.apache.org

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0
    • PMD
    • None
    • Patch

    Description

      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?).

      Attachments

        1. canonical-files.patch
          5 kB
          Andreas Dangel

        Activity

          People

            olamy Olivier Lamy
            adangel Andreas Dangel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: