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

Exception parsing Spy log when Job name contains invalid XML characters (like "--")

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The plugin fails to parse the Spy logs when the Job name contains characters not accepted in XML comments.

      To reproduce the error it is enough to create a job with name TEST--job. The following message will appear in the Jenkins logs after the build finishes:

      ERROR: [withMaven] WARNING Exception parsing the logs generated by the Jenkins Maven Event Spy /srv/jslave/workspace/TEST--job@tmp/withMavena4ea94cc/maven-spy-20170920-180259-419.log, ignore file.  Please report a bug associated for the component 'pipeline-maven-plugin' at https://issues.jenkins-ci.org 
      ERROR: org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 33; The string "--" is not permitted within comments.

      The plugin stores the job name as an XML comment in the Spy log and the job name is made of invalid characters for an XML comment.

      Tested with pipeline-maven-plugin version 3.0.0

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Cyrille Le Clerc
          Path:
          maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/JenkinsMavenEventSpy.java
          http://jenkins-ci.org/commit/pipeline-maven-plugin/1e92c1337e6f50ecf126684652394419c3aec03b
          Log:
          JENKINS-47013 Fix XML file format when the file path of the working directory contains "--".
          Workaround the fact that org.codehaus.plexus.util.xml.XmlWriterUtil#writeComment(org.codehaus.plexus.util.xml.XMLWriter, java.lang.String) doesn't escaped the reserved char sequence '--'

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/JenkinsMavenEventSpy.java http://jenkins-ci.org/commit/pipeline-maven-plugin/1e92c1337e6f50ecf126684652394419c3aec03b Log: JENKINS-47013 Fix XML file format when the file path of the working directory contains "--". Workaround the fact that org.codehaus.plexus.util.xml.XmlWriterUtil#writeComment(org.codehaus.plexus.util.xml.XMLWriter, java.lang.String) doesn't escaped the reserved char sequence '--'
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Cyrille Le Clerc
          Path:
          maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/JenkinsMavenEventSpy.java
          http://jenkins-ci.org/commit/pipeline-maven-plugin/85f712dfeab6f99dec6b14d18e065156e45b6c54
          Log:
          Merge pull request #99 from jenkinsci/JENKINS-47013

          JENKINS-47013 Fix XML file format when the file path of the working directory contains "--"

          Compare: https://github.com/jenkinsci/pipeline-maven-plugin/compare/221da6c875c1...85f712dfeab6

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: maven-spy/src/main/java/org/jenkinsci/plugins/pipeline/maven/eventspy/JenkinsMavenEventSpy.java http://jenkins-ci.org/commit/pipeline-maven-plugin/85f712dfeab6f99dec6b14d18e065156e45b6c54 Log: Merge pull request #99 from jenkinsci/ JENKINS-47013 JENKINS-47013 Fix XML file format when the file path of the working directory contains "--" Compare: https://github.com/jenkinsci/pipeline-maven-plugin/compare/221da6c875c1...85f712dfeab6
          Show
          cleclerc Cyrille Le Clerc added a comment - - edited Bertrand Renuart can you please test https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/pipeline-maven/3.0.1-beta-1/pipeline-maven-3.0.1-beta-1.hpi , it should fix the problem.
          Hide
          brenuart Bertrand Renuart added a comment -

          Tested and it works better, thanks !

           

          Show
          brenuart Bertrand Renuart added a comment - Tested and it works better, thanks !  
          Hide
          cleclerc Cyrille Le Clerc added a comment -

          3.0.1 when it's released

          Show
          cleclerc Cyrille Le Clerc added a comment - 3.0.1 when it's released

            People

            • Assignee:
              cleclerc Cyrille Le Clerc
              Reporter:
              brenuart Bertrand Renuart
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: