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

COPYARTIFACT_BUILD_NUMBER_ is not set when copyartifact plugin is ran as Maven pre-build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: copyartifact-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.492, Copy Artifact Plugin 1.25
    • Similar Issues:

      Description

      Create a freestyle build with 2 steps:
      1. Copy artifacts from another project (pick a random project and filename, set it to optional, Latest successful build)
      2. Execute Shell (contents: "set" - should work on windows/unix)
        RESULT: Shows COPYARTIFACT_BUILD_NUMBER_(project name) set as described
      Create a maven build with 2 pre-build steps:
      1. Copy artifacts from another project (pick a random project and filename, set it to optional, Latest successful build)
      2. Execute Shell (contents: "set" - should work on windows/unix)
        RESULT: DOES NOT SHOW COPYARTIFACT_BUILD_NUMBER_(project name) Set!

      Hopefully this is an easy and quick fix...thanks!

        Attachments

          Issue Links

            Activity

            Hide
            adam_rofer Adam Rofer added a comment -

            Assigning this to the plugin lead, hopefully this is ok

            Show
            adam_rofer Adam Rofer added a comment - Assigning this to the plugin lead, hopefully this is ok
            Hide
            thiagu Thiagarajan M T added a comment -

            I need this to be fixed for my project. Is there anyway we could get it fixed?

            Show
            thiagu Thiagarajan M T added a comment - I need this to be fixed for my project. Is there anyway we could get it fixed?
            Show
            ikedam ikedam added a comment - https://github.com/jenkinsci/copyartifact-plugin/pull/47
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java
            src/test/java/hudson/plugins/copyartifact/testutils/WrapperBuilder.java
            http://jenkins-ci.org/commit/copyartifact-plugin/6ccfac85e2f41a1152688408889849fb6c38f6b3
            Log:
            JENKINS-16028 JENKINS-18762 Added tests to reproduce JENKINS-16028 (environment variables are not set in maven prebuild), JENKINS-18762 (environment variables are not set when wrapped in another builder).

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java src/test/java/hudson/plugins/copyartifact/testutils/WrapperBuilder.java http://jenkins-ci.org/commit/copyartifact-plugin/6ccfac85e2f41a1152688408889849fb6c38f6b3 Log: JENKINS-16028 JENKINS-18762 Added tests to reproduce JENKINS-16028 (environment variables are not set in maven prebuild), JENKINS-18762 (environment variables are not set when wrapped in another builder).
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
            http://jenkins-ci.org/commit/copyartifact-plugin/581c57e7068bca29cdbfcdb15419ac7d8e3b1fa4
            Log:
            [FIXED JENKINS-16028] [FIXED JENKINS-18762] Adds EnvAction to hold COPYARTIFACT_BUILD_NUMBER_XXX when it's needed. It was added when a build starts and the build has copyartifact, which doesn't work for maven-project and copyartifacts wrapped in other builders.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/CopyArtifact.java http://jenkins-ci.org/commit/copyartifact-plugin/581c57e7068bca29cdbfcdb15419ac7d8e3b1fa4 Log: [FIXED JENKINS-16028] [FIXED JENKINS-18762] Adds EnvAction to hold COPYARTIFACT_BUILD_NUMBER_XXX when it's needed. It was added when a build starts and the build has copyartifact, which doesn't work for maven-project and copyartifacts wrapped in other builders.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
            src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java
            src/test/java/hudson/plugins/copyartifact/testutils/WrapperBuilder.java
            http://jenkins-ci.org/commit/copyartifact-plugin/c11b82688863105971e00cc27ad0501af436d903
            Log:
            Merge pull request #47 from ikedam/feature/JENKINS-16028_EnvActionWhenNeeded

            JENKINS-16028 JENKINS-18762 Adds EnvAction when it's needed

            Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/22eb37c9763a...c11b82688863

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/CopyArtifact.java src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java src/test/java/hudson/plugins/copyartifact/testutils/WrapperBuilder.java http://jenkins-ci.org/commit/copyartifact-plugin/c11b82688863105971e00cc27ad0501af436d903 Log: Merge pull request #47 from ikedam/feature/ JENKINS-16028 _EnvActionWhenNeeded JENKINS-16028 JENKINS-18762 Adds EnvAction when it's needed Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/22eb37c9763a...c11b82688863
            Hide
            ikedam ikedam added a comment -

            Fix released in 1.32

            Show
            ikedam ikedam added a comment - Fix released in 1.32

              People

              • Assignee:
                ikedam ikedam
                Reporter:
                adam_rofer Adam Rofer
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: