You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2021/05/08 20:07:40 UTC
[logging-pipelines] branch master updated: Only use toolchains for
log4j 2.x
This is an automated email from the ASF dual-hosted git repository.
mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-pipelines.git
The following commit(s) were added to refs/heads/master by this push:
new 3b2b09c Only use toolchains for log4j 2.x
3b2b09c is described below
commit 3b2b09c78f2f90f23bb69fb8c78348069f779db9
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sat May 8 15:07:11 2021 -0500
Only use toolchains for log4j 2.x
---
vars/mvn.groovy | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/vars/mvn.groovy b/vars/mvn.groovy
index 55653a1..4826bc4 100644
--- a/vars/mvn.groovy
+++ b/vars/mvn.groovy
@@ -18,8 +18,13 @@
def call(String args) {
String mavenHome = tool 'maven_3_latest'
String javaVersion = '1.8'
- if (env.JOB_NAME == 'Logging/log4j' && env.BRANCH_NAME == 'master') {
- javaVersion = '11'
+ boolean useToolchains = false
+ if (env.JOB_NAME == 'Logging/log4j') {
+ if (env.BRANCH_NAME == 'release-2.x' || env.CHANGE_TARGET == 'release-2.x') {
+ useToolchains = true
+ } else if (env.BRANCH_NAME == 'master' || env.CHANGE_TARGET == 'master') {
+ javaVersion = '11'
+ }
} else if (env.JOB_NAME == 'Logging/chainsaw') {
javaVersion = '9'
}
@@ -29,13 +34,13 @@ def call(String args) {
configFileProvider([configFile(fileId: 'ubuntu', variable: 'TOOLCHAINS')]) {
// note that the jenkins system property is set here to activate certain pom properties in
// some log4j modules that compile against system jars (e.g., log4j-jmx-gui)
- sh "mvn --toolchains \"\$TOOLCHAINS\" -Djenkins ${args}"
+ sh "mvn ${useToolchains ? '--toolchains "$TOOLCHAINS"' : ''} -Djenkins ${args}"
}
}
} else {
withEnv(["JAVA_HOME=$javaHome", "PATH+MAVEN=${mavenHome}\\bin;${javaHome}\\bin"]) {
configFileProvider([configFile(fileId: 'windows', variable: 'TOOLCHAINS')]) {
- bat "mvn --toolchains \"%TOOLCHAINS%\" ${args}"
+ bat "mvn ${useToolchains ? '--toolchains "%TOOLCHAINS%"' : ''} ${args}"
}
}
}