1

I'm trying to set-up jenkins build pipeline. It should contains three steps:

  1. Build project
  2. Publish artifact to nexus
  3. Deploy artifact to host

Step 2 should trigger step 3 with full nexus artifact name as a parameter. I don't know how to obtain that value.

Here is my gradle configuration:

uploadArchives {
    repositories {
        mavenDeployer{
            repository(url: "hereMyNexusRepo") {
                authentication(userName: "admin", password: "admin123")
            }
            pom.version = "1.0-SNAPSHOT"
            pom.artifactId = "artifactId"
            pom.groupId = "groupId"
            pom.packaging='jar'
        }
    }
}

Artifact published by this task has a name that is concatenation of 3 known values:

  1. groupId
  2. artifactId
  3. version

and unknown values

  1. date
  2. time

Sample artifact path looks as follow:

groupId/1.0-SNAPSHOT/artifactId-1.0-20170323.225852-2.jar

How can I get this path? Or can I override it from Jenkins?

pmajcher
  • 537
  • 6
  • 14

0 Answers0