pipeline { agent any stages { stage ('Build') { when { expression { env.BRANCH_NAME == '3.x' } } steps { sh "rm -rf build/libs/" sh "chmod +x gradlew" sh "./gradlew clean --stacktrace" sh "./gradlew build curseforge --refresh-dependencies --stacktrace" sh "./gradlew build publish --stacktrace" archiveArtifacts artifacts: '**/build/libs/*.jar', fingerprint: true } } } }