Skip to content

Commit

Permalink
Declare required jdk and maven as top-level pipeline tools in I-builds
Browse files Browse the repository at this point in the history
Since eclipse-platform/eclipse.platform.swt#973
the I-build (like the SWT build) requires a java-17 (or later) jdk on
the PATH system environment-variable in order to launch a jdk>=17 with
the 'java' command from the CLI. Just setting the JAVA_HOME variable to
a path pointing to a jdk-17 is not sufficient since the the java
executable is usually located in '$JAVA_HOME/bin'. And while the maven
launch script searches in '$JAVA_HOME/bin' for a java executable to run
the build itself, a simple java command on the CLI isn't that smart.
Previously running the 'java' command would just run the default default
java version on the Jenkins executor.

In general this simplifies the build-configuration because the JDK to
use is only defined once and used everywhere.

Fixes #1724
  • Loading branch information
HannesWell committed Jan 15, 2024
1 parent ac07616 commit 9e5e734
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions JenkinsJobs/Builds/I_build.groovy
Expand Up @@ -147,13 +147,15 @@ spec:
"""
}
}
tools {
jdk 'openjdk-jdk17-latest'
maven 'apache-maven-latest'
}
environment {
MAVEN_OPTS = "-Xmx6G"
CJE_ROOT = "${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production"
PATH = "$PATH:/opt/tools/apache-maven/latest/bin"
logDir = "$CJE_ROOT/buildlogs"
}
stages {
stage('Clean Workspace'){
steps {
Expand Down Expand Up @@ -234,8 +236,7 @@ spec:
steps {
container('jnlp') {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
withAnt(installation: 'apache-ant-latest', jdk: 'openjdk-jdk17-latest') {
withAnt(installation: 'apache-ant-latest') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb020_createBaseBuilder.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb020_createBaseBuilder.sh.log
Expand All @@ -246,7 +247,6 @@ spec:
fi
\'\'\'
}
}
}
}
}
Expand Down Expand Up @@ -310,7 +310,6 @@ spec:
stage('Create Source Bundles'){
steps {
container('jnlp') {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
Expand All @@ -322,7 +321,6 @@ spec:
exit 1
fi
\'\'\'
}
}
}
}
Expand All @@ -333,7 +331,6 @@ spec:
}
steps {
container('jnlp') {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
Expand All @@ -345,7 +342,6 @@ spec:
exit 1
fi
\'\'\'
}
}
}
}
Expand All @@ -356,8 +352,7 @@ spec:
}
steps {
container('jnlp') {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
withAnt(installation: 'apache-ant-latest', jdk: 'openjdk-jdk17-latest') {
withAnt(installation: 'apache-ant-latest') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
bash -x ./mb300_gatherEclipseParts.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb300_gatherEclipseParts.sh.log
Expand All @@ -368,7 +363,6 @@ spec:
fi
\'\'\'
}
}
}
}
}
Expand All @@ -379,8 +373,7 @@ spec:
}
steps {
container('jnlp') {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
withAnt(installation: 'apache-ant-latest', jdk: 'openjdk-jdk17-latest') {
withAnt(installation: 'apache-ant-latest') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb310_gatherEquinoxParts.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb310_gatherEquinoxParts.sh.log
Expand All @@ -391,14 +384,12 @@ spec:
fi
\'\'\'
}
}
}
}
}
stage('Generate Repo reports'){
steps {
container('jnlp') {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
Expand All @@ -410,14 +401,12 @@ spec:
exit 1
fi
\'\'\'
}
}
}
}
stage('Generate API tools reports'){
steps {
container('jnlp') {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
Expand All @@ -429,7 +418,6 @@ spec:
exit 1
fi
\'\'\'
}
}
}
}
Expand Down

0 comments on commit 9e5e734

Please sign in to comment.