maven prep

This commit is contained in:
zelophed 2025-02-27 17:45:25 +01:00
parent e367be9d70
commit 8fdb2326d0
2 changed files with 64 additions and 0 deletions

52
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,52 @@
#!/usr/bin/env groovy
pipeline {
agent any
tools {
jdk "jdk-17.0.1"
}
stages {
stage('Setup') {
steps {
echo 'Setup Project'
sh 'chmod +x gradlew'
sh './gradlew clean'
}
}
stage('Build') {
steps {
withCredentials([
file(credentialsId: 'build_secrets', variable: 'ORG_GRADLE_PROJECT_secretFile')
]) {
echo 'Building project.'
sh './gradlew build publish --stacktrace --warn'
}
}
}
}
post {
always {
archiveArtifacts artifacts: '**/build/libs/*.jar', fingerprint: true
withCredentials([
string(credentialsId: 'discord_webhook_url', variable: 'DISCORD_URL')
]) {
echo 'Notifying Discord..'
discordSend description: "Build: #${currentBuild.number}", link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: env.DISCORD_URL, showChangeset: true, enableArtifactsList: false
}
}
}
}

View file

@ -314,6 +314,18 @@ project.publishing {
}
repositories {
if (project.hasProperty("mavenUsername") && project.hasProperty("mavenPassword") && project.hasProperty("mavenURL")) {
project.logger.lifecycle("Adding maven from secrets")
maven {
credentials {
username = project.property("mavenUsername") as String
password = project.property("mavenPassword") as String
}
url = URI.create(project.property("mavenURL") as String)
}
}
if (project.hasProperty('mavendir')) {
maven { url mavendir }
}