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

Path problems when using sh of git for windows

      Having a windows build node using sh.exe in the path from git for windows withMaven has problems with mavenSettingsFilePath and mavenLocalRepo because Backslashes are not escaped.

      C:\foo\bar must be C:\\foo
      bar

      withMaven(mavenSettingsFilePath: env.WORKSPACE + "\\foo
      bar")

      This works when using bat mvn instead of sh mvn inside the withMaven block.

          [JENKINS-51689] Path problems when using sh of git for windows

          Michael Düsterhus created issue -
          Cyrille Le Clerc made changes -
          Assignee Original: Alvaro Lobato [ alobato ] New: Cyrille Le Clerc [ cleclerc ]
          Cyrille Le Clerc made changes -
          Link New: This issue is related to JENKINS-47704 [ JENKINS-47704 ]
          Cyrille Le Clerc made changes -
          Labels New: cygwin

          Cyrille Le Clerc added a comment - - edited

          reitzmichnicht we are aware that the withMaven plugin does not work well with Cygwin style "sh" call on Windows. Contributions are welcome, I don't work on Windows so it is very hard for me to work on this kind of feature.

          Cyrille Le Clerc added a comment - - edited reitzmichnicht we are aware that the withMaven plugin does not work well with Cygwin style "sh" call on Windows. Contributions are welcome, I don't work on Windows so it is very hard for me to work on this kind of feature.
          Michael Düsterhus made changes -
          Link New: This issue is duplicated by JENKINS-52241 [ JENKINS-52241 ]

          As mentioned in the duplicate issue, "does not work well" is more like does not work at all.

          Any hints where in the code I should take a look to fix this issue?

          Michael Düsterhus added a comment - As mentioned in the duplicate issue, "does not work well" is more like does not work at all. Any hints where in the code I should take a look to fix this issue?

          Cyrille Le Clerc added a comment - Thanks reitzmichnicht for the proposal. The code is located in WithMavenStepExecution.java https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.5.9/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java
          Arnaud Héritier made changes -
          Assignee Original: Cyrille Le Clerc [ cleclerc ]

            Unassigned Unassigned
            reitzmichnicht Michael Düsterhus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: