From f9acdeaf14fb580f20f9bdb32e72f8bbc20a06f5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 13 Dec 2025 16:27:09 -0800 Subject: [PATCH 1/7] empty commit, testing webhooks From 6b6263d0b352e7757cd4f647ce5d1bbfe03d5dc4 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 14 Dec 2025 12:52:27 -0800 Subject: [PATCH 2/7] Add deploy to Nexus stage --- Jenkinsfile | 79 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f4dcbe36..fe54592e0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,35 +1,60 @@ 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') { - steps { - sh ''' - mvn -V -B clean package - ''' - } - } - } + stage('Build') { + steps { + sh 'mvn -V -B clean package' + } + } - post { - success { - archiveArtifacts artifacts: 'target/mcMMO.jar', fingerprint: true - } - } + stage('Deploy to Nexus') { + when { + branch 'master' + } + steps { + withCredentials([usernamePassword( + credentialsId: 'nexus-deployer', + usernameVariable: 'NEXUS_USER', + passwordVariable: 'NEXUS_PASS' + )]) { + writeFile file: 'settings.xml', text: """ + + + + neetgames + ${env.NEXUS_USER} + ${env.NEXUS_PASS} + + + + """ + sh 'mvn -s settings.xml -V -B deploy' + } + } + } + } + post { + success { + archiveArtifacts artifacts: 'target/mcMMO.jar', fingerprint: true + } + } } From fc62946e272dc53dfcf02e2b5bce7777f2cc2d3e Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 14 Dec 2025 13:07:11 -0800 Subject: [PATCH 3/7] Try this instead... --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fe54592e0..2394613a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,9 +26,11 @@ pipeline { } stage('Deploy to Nexus') { - when { - branch 'master' - } + when { + expression { + return sh(script: 'git rev-parse --abbrev-ref HEAD', returnStdout: true).trim() == 'master' + } + } steps { withCredentials([usernamePassword( credentialsId: 'nexus-deployer', From 283c6d97719eee3dcf6bf49e9e5e2babd037e494 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 14 Dec 2025 13:08:41 -0800 Subject: [PATCH 4/7] Technically we don't need this --- Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2394613a2..754b697c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,11 +26,6 @@ pipeline { } stage('Deploy to Nexus') { - when { - expression { - return sh(script: 'git rev-parse --abbrev-ref HEAD', returnStdout: true).trim() == 'master' - } - } steps { withCredentials([usernamePassword( credentialsId: 'nexus-deployer', From 2f452afdc7ce01f3ddedeecb1a5061985ff2443d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 14 Dec 2025 13:17:59 -0800 Subject: [PATCH 5/7] try this instead part 3 --- Jenkinsfile | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 754b697c2..5f110cae8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,28 +25,27 @@ pipeline { } } - stage('Deploy to Nexus') { - steps { - withCredentials([usernamePassword( - credentialsId: 'nexus-deployer', - usernameVariable: 'NEXUS_USER', - passwordVariable: 'NEXUS_PASS' - )]) { - writeFile file: 'settings.xml', text: """ - - - - neetgames - ${env.NEXUS_USER} - ${env.NEXUS_PASS} - - - - """ - sh 'mvn -s settings.xml -V -B deploy' - } - } - } + stage('Deploy to Nexus') { + steps { + withCredentials([usernamePassword( + credentialsId: 'nexus-deployer', + usernameVariable: 'NEXUS_USER', + passwordVariable: 'NEXUS_PASS' + )]) { + configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS_TEMPLATE')]) { + sh ''' + # Expand env vars into a real settings file + envsubst < "$MAVEN_SETTINGS_TEMPLATE" > settings.xml + + mvn -s settings.xml -V -B deploy + + rm -f settings.xml + ''' + } + } + } + } + } post { From 257292b6cc9ff120779f30bba968943fbbdf62c5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 14 Dec 2025 13:31:21 -0800 Subject: [PATCH 6/7] test number who knows --- Jenkinsfile | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5f110cae8..f3b4bd3ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,21 +26,10 @@ pipeline { } stage('Deploy to Nexus') { - steps { - withCredentials([usernamePassword( - credentialsId: 'nexus-deployer', - usernameVariable: 'NEXUS_USER', - passwordVariable: 'NEXUS_PASS' - )]) { - configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS_TEMPLATE')]) { - sh ''' - # Expand env vars into a real settings file - envsubst < "$MAVEN_SETTINGS_TEMPLATE" > settings.xml - - mvn -s settings.xml -V -B deploy - - rm -f settings.xml - ''' + stage('Deploy to Nexus') { + steps { + configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS')]) { + sh 'mvn -s "$MAVEN_SETTINGS" -V -B deploy' } } } From a907bfd6241dbd30ade5e9dec5de58c8ea19e7a6 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 14 Dec 2025 13:32:36 -0800 Subject: [PATCH 7/7] oops --- Jenkinsfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f3b4bd3ad..b23854fb6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,11 +26,9 @@ pipeline { } stage('Deploy to Nexus') { - stage('Deploy to Nexus') { - steps { - configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS')]) { - sh 'mvn -s "$MAVEN_SETTINGS" -V -B deploy' - } + steps { + configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS')]) { + sh 'mvn -s "$MAVEN_SETTINGS" -V -B deploy' } } }