Last active
July 1, 2019 14:59
-
-
Save yogan/ff1d0ef968965bebb203f7adbf3188bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
// tools, global options, etc. | |
stages { | |
// build, test, etc. | |
stage("Publish CLI delivery to Nexus") { | |
steps { | |
dir("cli") { | |
// publish using maven coordinates from pom.xml | |
// needs Jenkins plugin: Pipeline Utility Steps | |
// https://support.sonatype.com/hc/en-us/articles/115009108987-Jenkins-Publish-Using-Maven-Coordinates-from-the-pom-xml | |
script { | |
def pom = readMavenPom file: 'pom.xml' | |
nexusPublisher nexusInstanceId: 'nexus', \ | |
nexusRepositoryId: 'FIXME: INSERT-GROUP-NAME-HERE', \ | |
packages: [[$class: 'MavenPackage', \ | |
mavenAssetList: [[classifier: '', extension: '', \ | |
filePath: "target/${pom.artifactId}-${pom.version}.${pom.packaging}"]], \ | |
mavenCoordinate: [artifactId: "${pom.artifactId}", \ | |
groupId: "${pom.groupId}", \ | |
packaging: "${pom.packaging}", \ | |
version: "${pom.version}"]]] | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment