Here below is the pipeline code for uploading build artifacts to Nexus from Jenkins:
Prerequisite:
1) Install Nexus Artifact Uploader plug-in.
2) You also need to add Nexus credentials and use the credentials ID from Jenkins
stage ('Nexus Artifact upload')
{
nexusArtifactUploader(
nexusVersion: 'nexus3',
protocol: 'http',
nexusUrl: 'ec2-18-223-182-14.us-east-2.compute.amazonaws.com:8081',
groupId: 'myGroupId',
version: '1.0-SNAPSHOT',
repository: 'maven-snapshots',
credentialsId: '2c293828-9509-49b4-a6e7-77f3ceae7b39',
artifacts: [
[artifactId: 'MyWebApp',
classifier: '',
file: 'MyWebApp/target/MyWebApp.war',
type: 'war']
]
)
}
Prerequisite:
1) Install Nexus Artifact Uploader plug-in.
2) You also need to add Nexus credentials and use the credentials ID from Jenkins
stage ('Nexus Artifact upload')
{
nexusArtifactUploader(
nexusVersion: 'nexus3',
protocol: 'http',
nexusUrl: 'ec2-18-223-182-14.us-east-2.compute.amazonaws.com:8081',
groupId: 'myGroupId',
version: '1.0-SNAPSHOT',
repository: 'maven-snapshots',
credentialsId: '2c293828-9509-49b4-a6e7-77f3ceae7b39',
artifacts: [
[artifactId: 'MyWebApp',
classifier: '',
file: 'MyWebApp/target/MyWebApp.war',
type: 'war']
]
)
}
Highly vigorous blog, I liked that much.
ReplyDeleteweb site design company
I guess this blog is perfectly incomparable.
ReplyDeleteUI/UX design agency