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

regression: 3.0.3 no longer supports whitespaces in job name

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      A regression has been introduced in this commit:
      https://github.com/jenkinsci/pipeline-maven-plugin/commit/c7d85c5291603ecff2c721f2255e18d9b9175a4e#diff-faa9e5307f768068d1e5a7fa655b44b9R310
      When there are spaces in the job name, and thus the workspace path (and its associated temporary dir), the generated $MAVEN_CONFIG variable is no more always a valid list of mvn command line options. The Maven global and user settings files are in the job's tmp dir, and thus can have spaces in their path, leading to something like this for a job named "build Something":

       [jenkins-maven-event-spy] INFO generate /home/jenkins/workspace/build Something@tmp/withMaveneb8f05cc/maven-spy-20171127-120841-7484912681885066084612.log.tmp ...
       [ERROR] Error executing Maven.
       [ERROR] The specified user settings file does not exist: /home/jenkins/workspace/build
       [Pipeline] }
       [withMaven] One or multiple Maven executions have been ignored by the Jenkins Pipeline Maven Plugin because they have been interrupted before completion (1). See Pipeline Maven Plugin FAQ for more details.
      

      Also I've not tried, I assume that using a job specific Maven local repo could trigger a similar issue (through the -Dmaven.repo.local=... argument).

      This used to work fine in 3.0.2, because ArgumentListBuilder was doing the right thing (quoting in toString()) to generate the complete command line. Fixing this in 3.0.3 is not obvious at first glance; the whole idea of using a string environment variable ($MAVEN_CONFIG) as a list of command line arguments is wrong when you don't have enough guarantee about what these arguments look like.

      I understand the change was introduced to better support "mvnw" from Takari Maven wrapper. Maybe one option could be to not use this variable in the "withMaven Wrapper script"? (keep using an ArgumentListBuilder to generate your wrapper, and leave the broken $MAVEN_CONFIG thing to users of the mvnw script)

      Or issue a warning message when you detect spaces in the workspace path?

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Cyrille Le Clerc
            Path:
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java
            http://jenkins-ci.org/commit/pipeline-maven-plugin/c599a50b93125f63c911d7e1859b47610e9b8f49
            Log:
            JENKINS-48264 Support whitespace in pipeline name (#111)

            JENKINS-48264 Support whitespaces in pipeline name

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java http://jenkins-ci.org/commit/pipeline-maven-plugin/c599a50b93125f63c911d7e1859b47610e9b8f49 Log: JENKINS-48264 Support whitespace in pipeline name (#111) JENKINS-48264  Support whitespaces in pipeline name
            Hide
            cleclerc Cyrille Le Clerc added a comment -

            Fixed in 3.0.4

            Show
            cleclerc Cyrille Le Clerc added a comment - Fixed in 3.0.4
            Hide
            cleclerc Cyrille Le Clerc added a comment -

            Thomas de Grenier de Latour can you please test 3.0.4?

            Show
            cleclerc Cyrille Le Clerc added a comment - Thomas de Grenier de Latour can you please test 3.0.4?
            Hide
            tom_gl Thomas de Grenier de Latour added a comment -

            Thanks Cyrille Le Clerc for the fix, and the quick release.  I've tested 3.0.4 successfully:

            • on the Jenkins instance where the regression was detected last week, by restoring the user's original "build Something" job
            • by running the 3.0.4 plugin unit tests with a patched JTH which forces slaves to work under a path with whitechars (using the JTH patch I've mentioned in a previous comment)
            Show
            tom_gl Thomas de Grenier de Latour added a comment - Thanks Cyrille Le Clerc for the fix, and the quick release.  I've tested 3.0.4 successfully: on the Jenkins instance where the regression was detected last week, by restoring the user's original "build Something" job by running the 3.0.4 plugin unit tests with a patched JTH which forces slaves to work under a path with whitechars (using the JTH patch I've mentioned in a previous comment)
            Hide
            cleclerc Cyrille Le Clerc added a comment -
            Show
            cleclerc Cyrille Le Clerc added a comment - Thomas de Grenier de Latour thanks!

              People

              • Assignee:
                cleclerc Cyrille Le Clerc
                Reporter:
                tom_gl Thomas de Grenier de Latour
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: