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

Generated Artifact Archiver doesn't work on Windows Agents

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The o.j.p.pipeline.maven.reporters.GeneratedArtifactsReporter doesn't work on Windows agents.

      org.jenkinsci.plugins.pipeline.maven.util.XmlUtils#getPathInWorkspace() uses an hardcoded file separator "/" that works on Linux and MacOS but NOT on Windows.

      https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-parent-2.0.2/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java#L183

      /**
       * @return empty string if not matching
       */
      @Nonnull
      public static String getPathInWorkspace(@Nonnull String absoluteFilePath, @Nonnull FilePath workspace) {
          String workspaceRemote = workspace.getRemote();
          if (!workspaceRemote.endsWith("/")) {
              workspaceRemote = workspaceRemote + "/";
          }
          if (absoluteFilePath.startsWith(workspaceRemote)) {
              return StringUtils.substringAfter(absoluteFilePath, workspaceRemote);
          } else {
              return absoluteFilePath;
          }
      }
      

        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/util/XmlUtils.java
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/reporters/GeneratedArtifactsReporterTest.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/maven-spy-windows.xml
            http://jenkins-ci.org/commit/pipeline-maven-plugin/3fb342b2ab05bd23e7521672a333a7dcbdb28d11
            Log:
            JENKINS-43624 Fix file separator on windows build agents

            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/util/XmlUtils.java jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/reporters/GeneratedArtifactsReporterTest.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/maven-spy-windows.xml http://jenkins-ci.org/commit/pipeline-maven-plugin/3fb342b2ab05bd23e7521672a333a7dcbdb28d11 Log: JENKINS-43624 Fix file separator on windows build agents
            Show
            cleclerc Cyrille Le Clerc added a comment - WIP  https://github.com/jenkinsci/pipeline-maven-plugin/pull/49
            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/util/XmlUtils.java
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/reporters/GeneratedArtifactsReporterTest.java
            jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/maven-spy-windows.xml
            http://jenkins-ci.org/commit/pipeline-maven-plugin/b3e05bbeddc4c1c958edc7e16cc5ee60216858ed
            Log:
            Merge pull request #49 from jenkinsci/JENKINS-43624

            JENKINS-43624 Fix file separator on windows build agents

            Compare: https://github.com/jenkinsci/pipeline-maven-plugin/compare/ebd8da1dd32c...b3e05bbeddc4

            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/util/XmlUtils.java jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/reporters/GeneratedArtifactsReporterTest.java jenkins-plugin/src/test/resources/org/jenkinsci/plugins/pipeline/maven/maven-spy-windows.xml http://jenkins-ci.org/commit/pipeline-maven-plugin/b3e05bbeddc4c1c958edc7e16cc5ee60216858ed Log: Merge pull request #49 from jenkinsci/ JENKINS-43624 JENKINS-43624 Fix file separator on windows build agents Compare: https://github.com/jenkinsci/pipeline-maven-plugin/compare/ebd8da1dd32c...b3e05bbeddc4
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Cyrille Le Clerc
            Path:
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtilsTest.java
            http://jenkins-ci.org/commit/pipeline-maven-plugin/f7ae91b38008e8f1cadadda7574d1afd457ab088
            Log:
            JENKINS-43624 more unit tests

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtilsTest.java http://jenkins-ci.org/commit/pipeline-maven-plugin/f7ae91b38008e8f1cadadda7574d1afd457ab088 Log: JENKINS-43624 more unit tests
            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/MavenSpyLogProcessor.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/FindbugsAnalysisReporter.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/GeneratedArtifactsReporter.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/JunitTestsReporter.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/TasksScannerReporter.java
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java
            http://jenkins-ci.org/commit/pipeline-maven-plugin/0181a5b1a985f23ef52cd07ab150e2ed4185d2d9
            Log:
            JENKINS-43624 always use the file separator of the build agent, don’t always use “/“. Particularly important for `jenkins.model.ArtifactManager#archive()` and Windows agents.

            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/MavenSpyLogProcessor.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/FindbugsAnalysisReporter.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/GeneratedArtifactsReporter.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/JunitTestsReporter.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/reporters/TasksScannerReporter.java jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java http://jenkins-ci.org/commit/pipeline-maven-plugin/0181a5b1a985f23ef52cd07ab150e2ed4185d2d9 Log: JENKINS-43624 always use the file separator of the build agent, don’t always use “/“. Particularly important for `jenkins.model.ArtifactManager#archive()` and Windows agents.
            Hide
            cleclerc Cyrille Le Clerc added a comment -
            Show
            cleclerc Cyrille Le Clerc added a comment - Fixed with Pipeline Maven Plugin version 2.2.0. https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-parent-2.2.0

              People

              • Assignee:
                cleclerc Cyrille Le Clerc
                Reporter:
                cleclerc Cyrille Le Clerc
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: