Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26638

org.xml.sax.SAXException: Input stream is not a PMD file

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: pmd-plugin
    • Labels:
    • Environment:
      Jenkins version is 1.597
      PMD Plugin is 3.40
      PMD version is 5.2.3 (also tried 4.2.6 which seems to be the latest supported by the plugin with the same results)
      OS is Debian 8.0 (jessie)
    • Similar Issues:

      Description

      I'm trying to parse results of PMD execution with PMD plugin but I'm getting this error:

      org.xml.sax.SAXException: Input stream is not a PMD file.
      at hudson.plugins.pmd.parser.PmdParser.parse(PmdParser.java:72)
      at hudson.plugins.analysis.core.AbstractAnnotationParser.parse(AbstractAnnotationParser.java:54)
      at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:323)
      at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:281)
      at hudson.plugins.analysis.core.FilesParser.parserCollectionOfFiles(FilesParser.java:232)
      at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:201)
      at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31)
      at hudson.FilePath.act(FilePath.java:989)
      at hudson.FilePath.act(FilePath.java:967)
      at hudson.plugins.pmd.PmdPublisher.perform(PmdPublisher.java:142)
      at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:152)
      at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:347)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
      at hudson.model.Run.execute(Run.java:1743)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)

      Command line execution from within a Execute Shell code block for PMD version 5.2.3 is: /opt/pmd-bin-5.2.3/bin/run.sh cpd --minimum-tokens 100 --files files-dir --language cpp --format xml --encoding UTF8 > pmd.xml

      Command line execution from within a Execute Shell code block for PMD version 4.2.6 is: java -cp /opt/pmd-bin-4.2.6/lib/asm-3.2.jar:/opt/pmd-bin-4.2.6/lib/jaxen-1.1.1.jar:/opt/pmd-bin-4.2.6/lib/junit-4.4.jar:/opt/pmd-bin-4.2.6/lib/pmd-4.2.6.jar net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files segmenter/ --language cpp --format xml > pmd.xml

      Please find attached the pmd.xml output file.

      I'm not sure if this is a bug or I'm doying something wrong, but I cannot find a solution to this problem.

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment - - edited

          The PMD plug-in reads only files from PMD. In order to read CPD files (which check for duplicate code) you need to use the dry plug-in. (Even though CPD is a part of the PMD suite I deecided to provide that functionality in a seperate plug-in since a different UI is needed.)

          Show
          drulli Ulli Hafner added a comment - - edited The PMD plug-in reads only files from PMD. In order to read CPD files (which check for duplicate code) you need to use the dry plug-in. (Even though CPD is a part of the PMD suite I deecided to provide that functionality in a seperate plug-in since a different UI is needed.)
          Hide
          xcarol Xavier Carol added a comment -

          Thanks for the clarification.

          Show
          xcarol Xavier Carol added a comment - Thanks for the clarification.

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              xcarol Xavier Carol
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: