No need to create your own Ruby scripts. Now there is a special plugin that does what you need: Maven metadata plugin for Jenkins CI server
Just mark "Parameterized Build" and "Add Parameter" of type "List of artifact versions of Maven":
- Name
MY_SNAPSHOT_JAR - Repository base URL (this complicated process)
http://localhost/nexus/service/local/repositories/snapshots/content
Then add the shell command to wget / scp / etc, you can use the following variables allowed by the plugin:
wget "$MY_SNAPSHOT_JAR_ARTIFACT_URL" echo "$MY_SNAPSHOT_JAR_VERSION" - the version you selected in the dropdown or that was selected as part of an automated build echo "$MY_SNAPSHOT_JAR_ARTIFACT_URL" - the full URL to the actual artifact selected. You can use something like "wget" to download that artifact and do something with it. echo "$MY_SNAPSHOT_JAR_GROUP_ID" - echoes back your configuration echo "$MY_SNAPSHOT_JAR_ARTIFACT_ID" - echoes back your configuration echo "$MY_SNAPSHOT_JAR_CLASSIFIER" - echoes back your configuration echo "$MY_SNAPSHOT_JAR_PACKAGING" - echoes back your configuration
Unfortunately, you cannot ask about the snapshot and release in the same drop-down list. A possible workaround is to add another parameter for MY_RELEASE_JAR (thus another drop-down list, somewhat confusing for the user). Another workaround is a separate task for deployment deployment.
kubanczyk
source share