We encounter error by parsing file (there was character not supported by XML 1.0 version).
      On build overview PMD plugin show that there is problem ("During parsing an error has been reported.") but build end with success. Consequently number of warning drop to 0.
      It would be nice that information about failure will be throw to Jenkins so that it tell us, that something is wrong.

      Console output with error:

      [PMD] ./pmd_report.xml failed due to an exception:
      
      org.xml.sax.SAXParseException; lineNumber: 1224; columnNumber: 26; An invalid XML character (Unicode: 0x1f) was found in the element content of the document.
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1236)
      	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
      	at org.apache.commons.digester.Digester.parse(Digester.java:1666)
      	at hudson.plugins.pmd.parser.PmdParser.parse(PmdParser.java:70)
      	at hudson.plugins.analysis.core.AbstractAnnotationParser.parse(AbstractAnnotationParser.java:53)
      	at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:306)
      	at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:264)
      	at hudson.plugins.analysis.core.FilesParser.parserCollectionOfFiles(FilesParser.java:215)
      	at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:184)
      	at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31)
      	at hudson.FilePath.act(FilePath.java:852)
      	at hudson.FilePath.act(FilePath.java:825)
      	at hudson.plugins.pmd.PmdPublisher.perform(PmdPublisher.java:139)
      	at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:146)
      	at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:331)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
      	at hudson.model.Run.execute(Run.java:1568)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:236)
      

          [JENKINS-17663] Fail by publishing report will fail whole build

          Ulli Hafner added a comment -

          Actually that behavior is by design: there should appear an "Error" link in the results of your build. Is this link not visible in your job?

          Ulli Hafner added a comment - Actually that behavior is by design: there should appear an "Error" link in the results of your build. Is this link not visible in your job?

          Peter Spireng added a comment -

          Thanks for answer. I see the link. But it is OK, that plugin end with error but whole build end with success? Usually we dont check build page as we rely on mail notification when build have problem. In this case we dont get information that there is some problem.

          Peter Spireng added a comment - Thanks for answer. I see the link. But it is OK, that plugin end with error but whole build end with success? Usually we dont check build page as we rely on mail notification when build have problem. In this case we dont get information that there is some problem.

          Ulli Hafner added a comment -

          I don't understand how this problem can occur in between successful PMD executions. Shouldn't the problem be only visible when you enable PMD using a wrong configuration?

          Ulli Hafner added a comment - I don't understand how this problem can occur in between successful PMD executions. Shouldn't the problem be only visible when you enable PMD using a wrong configuration?

          Peter Spireng added a comment -

          Ok. The story was so that:
          1. PMD + PMD plugin was set and work without problem
          2. we add new code that contains character "0x1f" and it was in string that was couple of times in code, so PMD generate warning about more occurrences of this string and copy string to PMD resolution report
          3. PMD plugin try to parse this report but this character isnt supported for XML 1.0 and end with error. But we noticed this about some time and only so, that graph suddenly show 0 count of PMD warnings.

          Hopefully now is more clear ...

          Peter Spireng added a comment - Ok. The story was so that: 1. PMD + PMD plugin was set and work without problem 2. we add new code that contains character "0x1f" and it was in string that was couple of times in code, so PMD generate warning about more occurrences of this string and copy string to PMD resolution report 3. PMD plugin try to parse this report but this character isnt supported for XML 1.0 and end with error. But we noticed this about some time and only so, that graph suddenly show 0 count of PMD warnings. Hopefully now is more clear ...

          Ulli Hafner added a comment -

          Ok, now I understand. I.e., this should be an option that could be activated.

          Ulli Hafner added a comment - Ok, now I understand. I.e., this should be an option that could be activated.

          Code changed in jenkins
          User: MihailMenev
          Path:
          http://jenkins-ci.org/commit/analysis-core-plugin/40ec0a84dfcdab2b88ad6a3ba28b2fed41b35285
          Log:
          Merge branch 'JENKINS-17663' of github.com:mmenev/analysis-core-plugin into JENKINS-17663

          Conflicts:
          src/main/java/hudson/plugins/analysis/core/GlobalSettings.java
          src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.jelly
          src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.properties

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: MihailMenev Path: http://jenkins-ci.org/commit/analysis-core-plugin/40ec0a84dfcdab2b88ad6a3ba28b2fed41b35285 Log: Merge branch ' JENKINS-17663 ' of github.com:mmenev/analysis-core-plugin into JENKINS-17663 Conflicts: src/main/java/hudson/plugins/analysis/core/GlobalSettings.java src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.jelly src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.properties

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/core/GlobalSettings.java
          src/main/java/hudson/plugins/analysis/core/HealthAwarePublisher.java
          src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.jelly
          src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.properties
          http://jenkins-ci.org/commit/analysis-core-plugin/309403780b6425e3f2a1ca2907e82d082a991a46
          Log:
          Merge pull request #18 from mmenev/JENKINS-17663

          [FIXED JENKINS-17663] Added global fail on error checkbox.

          Compare: https://github.com/jenkinsci/analysis-core-plugin/compare/7a18edf6769a...309403780b64

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/core/GlobalSettings.java src/main/java/hudson/plugins/analysis/core/HealthAwarePublisher.java src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.jelly src/main/resources/hudson/plugins/analysis/core/GlobalSettings/global.properties http://jenkins-ci.org/commit/analysis-core-plugin/309403780b6425e3f2a1ca2907e82d082a991a46 Log: Merge pull request #18 from mmenev/ JENKINS-17663 [FIXED JENKINS-17663] Added global fail on error checkbox. Compare: https://github.com/jenkinsci/analysis-core-plugin/compare/7a18edf6769a...309403780b64

            mmenev Mihail Menev
            peto127 Peter Spireng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: