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

readMavenPom / writeMavenPom does not preserve comments and formatting

    Details

    • Similar Issues:

      Description

      When you use readMavenPom / writeMavenPom in a build pipeline, the comments and formatting of the pom.xml file are not preserved.

        Attachments

          Activity

          Hide
          anbreensh Ambreen Sheikh added a comment -

          I am facing the same issue, the formatting is changed once the pom is written using "writeMavenPom" from the Jenkinsfile.

          Are there any updated on this issues ?

          Show
          anbreensh Ambreen Sheikh added a comment - I am facing the same issue, the formatting is changed once the pom is written using "writeMavenPom" from the Jenkinsfile. Are there any updated on this issues ?
          Hide
          kollerb04 koller b added a comment - - edited

          Also facing this issue, comments are wiped out when using writeMavenPom

          Show
          kollerb04 koller b added a comment - - edited Also facing this issue, comments are wiped out when using writeMavenPom
          Hide
          stevan Stevan Cvetkovic added a comment -

          Confirming the issue. Here is a quick way to reproduce it:

          node() {
           stage("Maven POMs test") {
             sh 'curl -s -o junit-4.12.pom -X GET https://search.maven.org/remotecontent?filepath=junit/junit/4.12/junit-4.12.pom'
             def pom = readMavenPom file: "junit-4.12.pom"
             writeMavenPom model: pom, file: "pom.xml"
             sh "diff -qr pom.xml junit-4.12.pom"
           }
          }
          Show
          stevan Stevan Cvetkovic added a comment - Confirming the issue. Here is a quick way to reproduce it: node() { stage( "Maven POMs test" ) { sh 'curl -s -o junit-4.12.pom -X GET https: //search.maven.org/remotecontent?filepath=junit/junit/4.12/junit-4.12.pom' def pom = readMavenPom file: "junit-4.12.pom" writeMavenPom model: pom, file: "pom.xml" sh "diff -qr pom.xml junit-4.12.pom" } }
          Hide
          oswaldodiaz Oswaldo Diaz added a comment -

          Same issue here, I'm using this plugin to update pom version automatically and when writing on pom it's using 2 spaces indentation instead of 4

          Show
          oswaldodiaz Oswaldo Diaz added a comment - Same issue here, I'm using this plugin to update pom version automatically and when writing on pom it's using 2 spaces indentation instead of 4

            People

            • Assignee:
              rsandell rsandell
              Reporter:
              jpraet Jimmy Praet
            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: