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

Missing deployed artifacts using getGeneratedArtifacts()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • pipeline-maven-plugin
    • Jenkins 2.204.1
      Pipeline Maven Integration Plugin 3.8.2

      Hello, 

      I'm trying to get all the list of deployed artifacts and save their url to be able to report them, or even to add this information into an artifactory buildinfo object.

      I'm using the code statedin the wiki:

       

      def deployed = ''
       Collection<org.jenkinsci.plugins.pipeline.maven.MavenArtifact> generatedArtifacts = currentBuild.rawBuild.getAction(org.jenkinsci.plugins.pipeline.maven.publishers.MavenReport.class).getGeneratedArtifacts();
      
       for (org.jenkinsci.plugins.pipeline.maven.MavenArtifact generatedArtifact:generatedArtifacts) {
       if (generatedArtifact.isDeployed()) { }
      

       

       

      The mvn deploy command is currently deploying 4 artifacts (jar, sources, javadoc and pom as 0.6.3-SNAPSHOT), those 4 artifacts are currently archived to jenkins if I do not disable the option, but when going to the list or to the generated artifacts list, I only get 3 downloadable artifacts and 5 in the list (pom is uploaded but missing from the list):

      maven-test-0.6.3-20200213.132009-3.jar
      maven-test-0.6.3-20200213.132009-3-sources.jar
      maven-test-0.6.3-20200213.132009-3-javadoc.jar
      maven-test-0.6.3-SNAPSHOT.jar
      maven-test-0.6.3-SNAPSHOT.pom

       I assume that if 4 artifacts are deployed to the maven repository, I would get 4 artifacts in the deployedArtifacts list and the link in the maven section should allow to download the 4 of them.

      I also don't undestand why in the list there is the jar and pom SNAPSHOT artifacts but not sources and javadoc (I would assume to show them all, or none of them), as in jenkins they are archived as 6.3.0-SNAPSHOT all of them.

            Unassigned Unassigned
            ricardf Ricard F
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: