Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ pipeline {
PROJECT_STORAGE_PATH = '/home/data/httpd/download.eclipse.org/modeling/emft/mwe'
DOWNLOAD_AREA = "$PROJECT_STORAGE_PATH/downloads/drops"
SCRIPTS = "$WORKSPACE/git-repo/releng/jenkins/scripts"
// Specify Temurin JDK explicitly in env variable and force toolchains:select-jdk-toolchain to use it,
// to prevent it from selecting the openjdk JDK listed in the default toolchains.xml.
JAVA_17_HOME = tool(type:'jdk', name:'temurin-jdk17-latest')
JAVA_21_HOME = tool(type:'jdk', name:'temurin-jdk21-latest')
}
tools {
jdk 'openjdk-jdk21-latest'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just using another JDK as default/JAVA_HOME referenced one as the one enforced for the toolchains plugin is simply another workaround for:

Once that fix is available, this can be changed to use temurin-jdk21-latest.

maven 'apache-maven-3.9.12'
}

Expand Down Expand Up @@ -78,13 +83,10 @@ pipeline {
} // END stage

stage ('Build') {
tools {
jdk 'temurin-jdk17-latest'
}
steps {
xvnc(useXauthority: true) {
dir ('git-repo') {
buildProject("org.eclipse.emf.mwe2.target")
buildProject("org.eclipse.emf.mwe2.target", 'JAVA_17_HOME')
}
}
} // END steps
Expand All @@ -96,14 +98,11 @@ pipeline {
} // END stage

stage ('Build Nightly') {
tools {
jdk 'temurin-jdk21-latest'
}
steps {
xvnc(useXauthority: true) {
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
dir ('git-repo-nightly') {
buildProject("org.eclipse.emf.mwe2.target.nightly", true)
buildProject("org.eclipse.emf.mwe2.target.nightly", 'JAVA_21_HOME', true)
}
}
}
Expand Down Expand Up @@ -263,8 +262,9 @@ EOF

}

def buildProject(targetPlatform, forceLocalDeployment = false) {
withEnv(["TARGET_PLATFORM=$targetPlatform", "FORCE_LOCAL_DEPLOYMENT=$forceLocalDeployment"]) {
def buildProject(targetPlatform, enforcedJDK = '', forceLocalDeployment = false) {
withEnv(["TARGET_PLATFORM=$targetPlatform", "FORCE_LOCAL_DEPLOYMENT=$forceLocalDeployment",
"STRICT_JDK_PROFILE=${ enforcedJDK ? ('-Pstrict-jdk -Dtoolchain.jdk.env=' + enforcedJDK) : ''}"]) {
sh '''
GOALS='clean deploy'
if [ "${TARGET_PLATFORM}" == "org.eclipse.emf.mwe2.target.nightly" ]; then
Expand All @@ -283,6 +283,7 @@ def buildProject(targetPlatform, forceLocalDeployment = false) {

mvn \
-f maven/org.eclipse.emf.mwe2.parent/pom.xml \
${STRICT_JDK_PROFILE} \
-Dsign.skip=false \
-Dtarget-platform=${TARGET_PLATFORM} \
-DBUILD_TYPE=$BUILD_TYPE \
Expand Down
25 changes: 24 additions & 1 deletion maven/org.eclipse.emf.mwe2.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<properties>
<tycho-qualifier>yyyyMMdd-HHmm</tycho-qualifier>

<tycho-version>4.0.11</tycho-version>
<tycho-version>5.0.2</tycho-version>
<maven.compiler.release>17</maven.compiler.release>
<maven-install-version>2.5.2</maven-install-version>
<maven-deploy-version>2.8.2</maven-deploy-version>
Expand Down Expand Up @@ -157,6 +157,11 @@
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
Expand Down Expand Up @@ -329,6 +334,24 @@
</plugins>
</build>
</profile>
<profile>
<id>strict-jdk</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>select-jdk-toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<scm>
<connection>scm:git:https://github.com/eclipse-mwe/mwe.git</connection>
Expand Down