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

          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.

          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

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

              Created:
              Updated: