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

Latest successful artifact cannot be copied from Maven build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: copyartifact-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.625.2, Copy Artifact Plugin 1.37
    • Similar Issues:

      Description

      Steps to reproduce:

      1. Create Maven build job #1. In the build job, check "Disable automatic artifact archiving".
      2. Create build job #2. Add "Copy artifacts from another project" build step. Set "Project name" to project #1. Set "Which build" to "latest successful build". Set "Artifacts to copy" to an existing artifact in project #1, e.g. **/my.war.
      3. Build job #2 fails with this error:
        Unable to access upstream artifacts area D:\jenkins\jobs\job1\modules\my.package$myapp\builds\510\archive. Does source project archive artifacts?
        ERROR: Unable to find a build for artifact copy from: JOB1

      Work-around:
      In job #2, set "Which build" to "Specified by permalink". Set permalink to "lastSuccessfulBuild".

        Attachments

          Issue Links

            Activity

            Hide
            ikedam ikedam added a comment -

            I couldn't get how to reproduce the problem.

            • How do you archive artifacts in job1?
            • "lastSuccessfulBuild" is build #510?
            • Are there files in D:\jenkins\jobs\job1\modules\my.package$myapp\builds\510\archive ?
            Show
            ikedam ikedam added a comment - I couldn't get how to reproduce the problem. How do you archive artifacts in job1? "lastSuccessfulBuild" is build #510? Are there files in D:\jenkins\jobs\job1\modules\my.package$myapp\builds\510\archive ?
            Hide
            ritzmann ritzmann added a comment -

            How do you archive artifacts in job1?

            It is a Maven project. The advanced settings are:

            • Disable automatic artifact archiving

            And then the post-build actions have this action:

            • Archive the artifacts

            And I can see from the job page that the artifacts are archived.

            "lastSuccessfulBuild" is build #510?

            Yes, and it does have downloadable artifacts.

            Are there files in D:\jenkins\jobs\job1\modules\my.package$myapp\builds\510\archive ?

            No, because module archiving was disabled. The 510 directory exists but not the archive subdirectory. The archived artifacts are in D:\jenkins\jobs\job1\builds\510\archive.

            Show
            ritzmann ritzmann added a comment - How do you archive artifacts in job1? It is a Maven project. The advanced settings are: Disable automatic artifact archiving And then the post-build actions have this action: Archive the artifacts And I can see from the job page that the artifacts are archived. "lastSuccessfulBuild" is build #510? Yes, and it does have downloadable artifacts. Are there files in D:\jenkins\jobs\job1\modules\my.package$myapp\builds\510\archive ? No, because module archiving was disabled. The 510 directory exists but not the archive subdirectory. The archived artifacts are in D:\jenkins\jobs\job1\builds\510\archive.
            Hide
            ikedam ikedam added a comment -

            Could not reproduce in my environment.
            Please let me know the detailed steps to reproduce the problem.

            Tested steps (tested with Windows 8.1 64bits, Java 1.7.0_79):

            1. Install and launch jenkins.1.625.2.
            2. Install following plugins:
              • copyartifact-plugin (tested with 1.37)
              • git-plugin (tested with 2.4.0, requires restarting Jenkins)
            3. Setup maven in Manage Jenkins > Configure System (tested with maven-3.1.1)
            4. Create a maven project "job1"
              • Git repository: https://github.com/jenkinsci/copyartifact-plugin.git
              • Goals and options: package -DskipTests=true
              • Check "Disable automatic artifact archiving" in the advanced section.
              • Add "Archive the artifacts" to "Post-build Actions"
                • Files to archive: target/*.hpi
            5. Run "job1". job1 #1 will finish successfully.
            6. Create a freestyle project "job2"
              • Add "Copy artifacts from another project"
                • Project name: job1
                • Which build: Last successful build
                • Artifacts to copy: **/*
            7. Run "job2"

            Result:

            • job2 #1 succeeds.
            • The log was:
              Started by user anonymous
              Building in workspace C:\Users\ikedam\.jenkins\jobs\job2\workspace
              Copied 1 artifact from "job1" build number 1
              Unable to access upstream artifacts area C:\Users\ikedam\.jenkins\jobs\job1\modules\org.jenkins-ci.plugins$copyartifact\builds\1\archive. Does source project archive artifacts?
              Finished: SUCCESS
              
              • The warning log was output as copyartifact scans all modules for artifacts. But that doesn't affect the build result.
            • job2 succeeds also with "Specified by permalink" and "lastSuccessfulBuild"
            Show
            ikedam ikedam added a comment - Could not reproduce in my environment. Please let me know the detailed steps to reproduce the problem. Tested steps (tested with Windows 8.1 64bits, Java 1.7.0_79): Install and launch jenkins.1.625.2. Install following plugins: copyartifact-plugin (tested with 1.37) git-plugin (tested with 2.4.0, requires restarting Jenkins) Setup maven in Manage Jenkins > Configure System (tested with maven-3.1.1) Create a maven project "job1" Git repository: https://github.com/jenkinsci/copyartifact-plugin.git Goals and options: package -DskipTests=true Check "Disable automatic artifact archiving" in the advanced section. Add "Archive the artifacts" to "Post-build Actions" Files to archive: target/*.hpi Run "job1". job1 #1 will finish successfully. Create a freestyle project "job2" Add "Copy artifacts from another project" Project name: job1 Which build: Last successful build Artifacts to copy: **/* Run "job2" Result: job2 #1 succeeds. The log was: Started by user anonymous Building in workspace C:\Users\ikedam\.jenkins\jobs\job2\workspace Copied 1 artifact from "job1" build number 1 Unable to access upstream artifacts area C:\Users\ikedam\.jenkins\jobs\job1\modules\org.jenkins-ci.plugins$copyartifact\builds\1\archive. Does source project archive artifacts? Finished: SUCCESS The warning log was output as copyartifact scans all modules for artifacts. But that doesn't affect the build result. job2 succeeds also with "Specified by permalink" and "lastSuccessfulBuild"
            Hide
            ikedam ikedam added a comment -

            Cannot reproduce.
            Please reopen this issue when you report detailed steps to reproduce the problem.

            Show
            ikedam ikedam added a comment - Cannot reproduce. Please reopen this issue when you report detailed steps to reproduce the problem.
            Hide
            fasterfish Marat S added a comment -

            To reproduce this problem, you must use the same steps as in the details. In addition, the very first step is to include the following: at jenkins global configuration at "Artifact Management for Builds" section need add "Compress Artifacts". (sorry for my english)

            Show
            fasterfish Marat S added a comment - To reproduce this problem, you must use the same steps as in the details. In addition, the very first step is to include the following: at jenkins global configuration at "Artifact Management for Builds" section need add "Compress Artifacts". (sorry for my english)
            Hide
            ikedam ikedam added a comment -

            Copyartifact doesn't support ArtifactManager (JENKINS-22637).
            It will be supported in copyartifact-1.40.

            Show
            ikedam ikedam added a comment - Copyartifact doesn't support ArtifactManager ( JENKINS-22637 ). It will be supported in copyartifact-1.40.

              People

              • Assignee:
                ritzmann ritzmann
                Reporter:
                ritzmann ritzmann
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: