|
|
@@ -1,35 +1,43 @@
|
|
|
pipeline {
|
|
|
- agent any
|
|
|
+ agent any
|
|
|
|
|
|
- tools {
|
|
|
- jdk 'jdk17'
|
|
|
- }
|
|
|
+ tools {
|
|
|
+ jdk 'jdk17'
|
|
|
+ // If you configured Maven as a Jenkins tool, add:
|
|
|
+ // maven 'Maven3'
|
|
|
+ }
|
|
|
|
|
|
- options {
|
|
|
- timestamps()
|
|
|
- disableConcurrentBuilds()
|
|
|
- }
|
|
|
+ options {
|
|
|
+ timestamps()
|
|
|
+ disableConcurrentBuilds()
|
|
|
+ }
|
|
|
|
|
|
- stages {
|
|
|
- stage('Checkout') {
|
|
|
- steps {
|
|
|
- checkout scm
|
|
|
- }
|
|
|
- }
|
|
|
+ stages {
|
|
|
+ stage('Checkout') {
|
|
|
+ steps {
|
|
|
+ checkout scm
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- stage('Build') {
|
|
|
+ stage('Build') {
|
|
|
+ steps {
|
|
|
+ sh 'mvn -V -B clean package'
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ stage('Deploy to Nexus') {
|
|
|
steps {
|
|
|
- sh '''
|
|
|
- mvn -V -B clean package
|
|
|
- '''
|
|
|
+ configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS')]) {
|
|
|
+ sh 'mvn -s "$MAVEN_SETTINGS" -V -B deploy'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- post {
|
|
|
- success {
|
|
|
- archiveArtifacts artifacts: 'target/mcMMO.jar', fingerprint: true
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
+ post {
|
|
|
+ success {
|
|
|
+ archiveArtifacts artifacts: 'target/mcMMO.jar', fingerprint: true
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|