mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-12-16 05:58:47 +01:00
Add deploy to Nexus stage
This commit is contained in:
33
Jenkinsfile
vendored
33
Jenkinsfile
vendored
@@ -3,6 +3,8 @@ pipeline {
|
||||
|
||||
tools {
|
||||
jdk 'jdk17'
|
||||
// If you configured Maven as a Jenkins tool, add:
|
||||
// maven 'Maven3'
|
||||
}
|
||||
|
||||
options {
|
||||
@@ -19,9 +21,33 @@ pipeline {
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh '''
|
||||
mvn -V -B clean package
|
||||
'''
|
||||
sh 'mvn -V -B clean package'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to Nexus') {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
steps {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: 'nexus-deployer',
|
||||
usernameVariable: 'NEXUS_USER',
|
||||
passwordVariable: 'NEXUS_PASS'
|
||||
)]) {
|
||||
writeFile file: 'settings.xml', text: """
|
||||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>neetgames</id>
|
||||
<username>${env.NEXUS_USER}</username>
|
||||
<password>${env.NEXUS_PASS}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
"""
|
||||
sh 'mvn -s settings.xml -V -B deploy'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,5 +57,4 @@ pipeline {
|
||||
archiveArtifacts artifacts: 'target/mcMMO.jar', fingerprint: true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user