From 16a996781362ad349d85b9d0eba5eb3017b10903 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Mon, 9 Oct 2023 15:27:12 +0200 Subject: [PATCH] Add build option for configuring maven central mirror --- Jenkinsfile | 2 +- ci/jpa-3.1-tck.Jenkinsfile | 2 +- ci/jpa-3.2-tck.Jenkinsfile | 2 +- ci/quarkus.Jenkinsfile | 2 +- settings.gradle | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fab71403a9..572c90ce1a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -79,7 +79,7 @@ stage('Build') { // Use withEnv instead of setting env directly, as that is global! // See https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md withEnv(["JAVA_HOME=${javaHome}", "PATH+JAVA=${javaHome}/bin"]) { - state[buildEnv.tag]['additionalOptions'] = '' + state[buildEnv.tag]['additionalOptions'] = '-PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com' if ( testJavaHome ) { state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] + " -Ptest.jdk.version=${buildEnv.testJdkVersion} -Porg.gradle.java.installations.paths=${javaHome},${testJavaHome}" diff --git a/ci/jpa-3.1-tck.Jenkinsfile b/ci/jpa-3.1-tck.Jenkinsfile index 40025fc85b..42c111fbe6 100644 --- a/ci/jpa-3.1-tck.Jenkinsfile +++ b/ci/jpa-3.1-tck.Jenkinsfile @@ -34,7 +34,7 @@ pipeline { } dir('hibernate') { checkout scm - sh './gradlew publishToMavenLocal -DjakartaJpaVersion=3.1.0' + sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -DjakartaJpaVersion=3.1.0' script { env.HIBERNATE_VERSION = sh ( script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2", diff --git a/ci/jpa-3.2-tck.Jenkinsfile b/ci/jpa-3.2-tck.Jenkinsfile index 52f878d11b..aea79eaf92 100644 --- a/ci/jpa-3.2-tck.Jenkinsfile +++ b/ci/jpa-3.2-tck.Jenkinsfile @@ -35,7 +35,7 @@ pipeline { } dir('hibernate') { checkout scm - sh './gradlew publishToMavenLocal -DjakartaJpaVersion=3.2.0-SNAPSHOT' + sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -DjakartaJpaVersion=3.2.0-SNAPSHOT' script { env.HIBERNATE_VERSION = sh ( script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2", diff --git a/ci/quarkus.Jenkinsfile b/ci/quarkus.Jenkinsfile index 6ea21b5640..b36fca32d8 100644 --- a/ci/quarkus.Jenkinsfile +++ b/ci/quarkus.Jenkinsfile @@ -25,7 +25,7 @@ pipeline { stage('Build') { steps { script { - sh './gradlew publishToMavenLocal --no-daemon' + sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com --no-daemon' script { env.HIBERNATE_VERSION = sh ( script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2", diff --git a/settings.gradle b/settings.gradle index 40bf394401..9499b8e5c8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -25,6 +25,9 @@ plugins { dependencyResolutionManagement { repositories { + if ( rootProject.hasProperty( "mavenMirror" ) ) { + url( rootProject.property( "mavenMirror" ) ) + } mavenCentral() // Needed for the RC versions of Jakarta Persistence maven {