Skip to content

Commit 9dbba37

Browse files
committed
Managing JDK versions and multireleases
- Jenkinsfile now compiles and tests with JDK25, then tests selected modules with 17 for sure - Removed java.version usages - quite toxic to set it - Removed copy pasted compiler settings (some of) - Minimal Maven version set to 3.9.16 - Minimal JDK version is 17 (to run tests without recompilation), to release 21. Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
1 parent f51ef43 commit 9dbba37

13 files changed

Lines changed: 83 additions & 168 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ name: "Validate"
1515
on: [pull_request, push]
1616

1717
env:
18-
JAVA_VERSION: '17'
18+
JAVA_VERSION: '21'
1919
JAVA_DISTRO: 'temurin'
2020

2121
concurrency:
@@ -69,4 +69,4 @@ jobs:
6969
java-version: ${{ env.JAVA_VERSION }}
7070
cache: maven
7171
- name: Test archetypes
72-
run: etc/scripts/test-archetypes.sh
72+
run: etc/scripts/test-archetypes.sh

‎archetypes/jersey-example-java8-webapp/src/main/resources/archetype-resources/pom.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
</profiles>
124124

125125
<properties>
126-
<java.version>17</java.version>
127126
<jersey.config.test.container.port>8080</jersey.config.test.container.port>
128127
</properties>
129128
</project>

‎connectors/helidon-connector/pom.xml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,32 @@
113113
</plugin>
114114
</plugins>
115115
</build>
116+
117+
<profiles>
118+
<profile>
119+
<id>skipTests</id>
120+
<activation>
121+
<jdk>[17,21)</jdk>
122+
</activation>
123+
<build>
124+
<plugins>
125+
<plugin>
126+
<artifactId>maven-compiler-plugin</artifactId>
127+
<executions>
128+
<execution>
129+
<id>default-testCompile</id>
130+
<phase>disable</phase>
131+
</execution>
132+
</executions>
133+
</plugin>
134+
<plugin>
135+
<artifactId>maven-failsafe-plugin</artifactId>
136+
<configuration>
137+
<skipITs>true</skipITs>
138+
</configuration>
139+
</plugin>
140+
</plugins>
141+
</build>
142+
</profile>
143+
</profiles>
116144
</project>

‎core-client/pom.xml‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,8 @@
4141
<inherited>true</inherited>
4242
</plugin>
4343
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
4544
<artifactId>maven-compiler-plugin</artifactId>
4645
<executions>
47-
<execution>
48-
<id>default-compile</id>
49-
<goals>
50-
<goal>compile</goal>
51-
</goals>
52-
<configuration>
53-
<source>${java.version}</source>
54-
<target>${java.version}</target>
55-
<compilerArgs>
56-
<!-- Do not warn about using sun.misc.Unsafe -->
57-
<XDignore.symbol.file/>
58-
</compilerArgs>
59-
</configuration>
60-
</execution>
6146
<execution>
6247
<id>default-testCompile</id>
6348
<goals>
@@ -73,7 +58,6 @@
7358
</executions>
7459
</plugin>
7560
<plugin>
76-
<groupId>org.apache.maven.plugins</groupId>
7761
<artifactId>maven-surefire-plugin</artifactId>
7862
<configuration>
7963
<!-- Execute test classes in parallel - 1 thread per CPU core. -->
@@ -83,20 +67,6 @@
8367
<forkCount>0</forkCount>
8468
</configuration>
8569
</plugin>
86-
87-
<plugin>
88-
<groupId>org.apache.maven.plugins</groupId>
89-
<artifactId>maven-jar-plugin</artifactId>
90-
<executions>
91-
<execution>
92-
<id>default-jar</id>
93-
<phase>package</phase>
94-
<goals>
95-
<goal>jar</goal>
96-
</goals>
97-
</execution>
98-
</executions>
99-
</plugin>
10070
<plugin>
10171
<groupId>org.apache.felix</groupId>
10272
<artifactId>maven-bundle-plugin</artifactId>
@@ -132,19 +102,6 @@
132102
<artifactId>jakarta.inject-api</artifactId>
133103
</dependency>
134104

135-
<!--
136-
<dependency>
137-
<groupId>jakarta.xml.bind</groupId>
138-
<artifactId>jakarta.xml.bind-api</artifactId>
139-
<scope>test</scope>
140-
</dependency>
141-
142-
<dependency>
143-
<groupId>jakarta.annotation</groupId>
144-
<artifactId>jakarta.annotation-api</artifactId>
145-
</dependency>
146-
-->
147-
148105
<dependency>
149106
<!-- not to warn about missing activation -->
150107
<groupId>org.eclipse.angus</groupId>

‎core-common/pom.xml‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<groupId>org.glassfish.jersey.core</groupId>
3030
<artifactId>jersey-common</artifactId>
3131
<packaging>jar</packaging>
32-
<name>jersey-core-common</name>
32+
<name>jersey-common</name>
3333

3434
<description>Jersey core common packages</description>
3535

@@ -87,9 +87,6 @@
8787
</plugin>
8888
<plugin>
8989
<artifactId>maven-compiler-plugin</artifactId>
90-
<configuration>
91-
<skipMain>${skipCompileMain}</skipMain>
92-
</configuration>
9390
<executions>
9491
<!-- Default is 17, but we have 21+ specific sources too -->
9592
<execution>
@@ -261,6 +258,15 @@
261258
</dependencies>
262259

263260
<profiles>
261+
<profile>
262+
<id>securityOff</id>
263+
<activation>
264+
<jdk>[24,)</jdk>
265+
</activation>
266+
<properties>
267+
<surefire.security.argline />
268+
</properties>
269+
</profile>
264270
<profile>
265271
<id>sonar</id>
266272
<build>
@@ -279,8 +285,6 @@
279285
</profiles>
280286

281287
<properties>
282-
<!-- Used by Jenkins to compile with 21 but test with 17 -->
283-
<skipCompileMain>false</skipCompileMain>
284288
<test.security.policy>${project.build.testOutputDirectory}/surefire.policy</test.security.policy>
285289
<surefire.security.argline>-Djava.security.manager -Djava.security.policy=${test.security.policy}</surefire.security.argline>
286290
</properties>

‎etc/jenkins/Jenkinsfile_ci_build‎

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,30 @@ pipeline {
1313

1414
stages {
1515
stage('Jersey build') {
16-
parallel {
17-
stage('JDK 17') {
18-
agent any
19-
tools {
20-
jdk 'temurin-jdk17-latest'
21-
maven 'apache-maven-latest'
22-
}
23-
steps {
24-
// Fastest possible check
25-
sh 'mvn -V -B -e -ntp clean install -DskipTests'
26-
// Tests
27-
sh 'mvn -B -e -ntp clean install -Dcheckstyle.skip=true'
28-
}
29-
}
30-
stage('JDK 25') {
31-
agent any
32-
tools {
33-
jdk 'temurin-jdk25-latest'
34-
maven 'apache-maven-latest'
35-
}
36-
steps {
37-
// Fastest possible check
38-
sh 'mvn -V -B -e -ntp clean install -DskipTests'
39-
// Check for version irregularities
40-
sh 'mvn -B -e -ntp clean verify -f tests/version-agnostic -Djersey.version=4.0.99-SNAPSHOT'
41-
// Tests
42-
sh 'mvn -B -e -ntp clean install -Dcheckstyle.skip=true -pl :e2e -Dtest=LeadingSlashesTest'
43-
// jenkins echo on own line, will be well visible in the GUI.
44-
echo "If dependency convergence fails, try to exclude some dependencies you don't need, or override them."
45-
sh '''
46-
export EXCLUDE_ARGS=''
47-
bash ${WORKSPACE}/etc/scripts/validation/dependency-convergence.sh
48-
'''
49-
}
16+
agent any
17+
tools {
18+
jdk 'temurin-jdk25-latest'
19+
maven 'apache-maven-latest'
20+
}
21+
steps {
22+
// Fastest possible check
23+
sh 'mvn -V -B -e -ntp clean install -DskipTests'
24+
// Check for version irregularities
25+
sh 'mvn -B -e -ntp clean verify -f tests/version-agnostic -Djersey.version=4.0.99-SNAPSHOT'
26+
27+
// Tests
28+
sh 'mvn -B -e -ntp clean install -Dcheckstyle.skip=true'
29+
30+
// jenkins echo on own line, will be well visible in the GUI.
31+
echo "If dependency convergence fails, try to exclude some dependencies you don't need, or override them."
32+
sh '''
33+
export EXCLUDE_ARGS=''
34+
bash ${WORKSPACE}/etc/scripts/validation/dependency-convergence.sh
35+
'''
36+
37+
// Tests with JDK17 without recompilation for multirelease jars
38+
withEnv(["JAVA_HOME=${tool 'temurin-jdk17-latest'}", "PATH+JDK=${tool 'temurin-jdk17-latest'}/bin"]) {
39+
sh 'mvn -B -e -ntp verify -Dcheckstyle.skip=true -DskipCompileMain=true -pl :jersey-common'
5040
}
5141
}
5242
}

‎examples/java8-webapp/pom.xml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
<artifactId>maven-compiler-plugin</artifactId>
4646
<inherited>true</inherited>
4747
<configuration>
48-
<source>${java.version}</source>
49-
<target>${java.version}</target>
5048
<showWarnings>false</showWarnings>
5149
<fork>false</fork>
5250
</configuration>

‎ext/metainf-services/pom.xml‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<pluginManagement>
3838
<plugins>
3939
<plugin>
40-
<groupId>org.apache.maven.plugins</groupId>
4140
<artifactId>maven-javadoc-plugin</artifactId>
4241
<configuration>
4342
<!--
@@ -51,16 +50,8 @@
5150
</pluginManagement>
5251
<plugins>
5352
<plugin>
54-
<groupId>org.apache.maven.plugins</groupId>
5553
<artifactId>maven-compiler-plugin</artifactId>
56-
<inherited>false</inherited>
5754
<configuration>
58-
<source>${java.version}</source>
59-
<target>${java.version}</target>
60-
<compilerArgs>
61-
<!-- Do not warn about using sun.misc.Unsafe -->
62-
<XDignore.symbol.file />
63-
</compilerArgs>
6455
<compilerArgs>
6556
<arg>-Xdiags:verbose</arg>
6657
</compilerArgs>
@@ -95,7 +86,6 @@
9586
</configuration>
9687
</plugin>
9788
<plugin>
98-
<groupId>org.apache.maven.plugins</groupId>
9989
<artifactId>maven-surefire-plugin</artifactId>
10090
<configuration>
10191
<test>**/MetaInfServicesTest*</test>

‎media/jaxb/pom.xml‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@
4343
<build>
4444
<resources>
4545
<resource>
46-
<directory>${basedir}/src/main/resources</directory>
46+
<directory>src/main/resources</directory>
4747
<filtering>true</filtering>
4848
</resource>
4949
</resources>
5050
<pluginManagement>
5151
<plugins>
5252
<plugin>
53-
<groupId>org.apache.maven.plugins</groupId>
5453
<artifactId>maven-javadoc-plugin</artifactId>
5554
<configuration>
5655
<!--
@@ -63,35 +62,17 @@
6362
</plugins>
6463
</pluginManagement>
6564
<plugins>
66-
<plugin>
67-
<groupId>org.apache.maven.plugins</groupId>
68-
<artifactId>maven-compiler-plugin</artifactId>
69-
<inherited>false</inherited>
70-
<configuration>
71-
<source>${java.version}</source>
72-
<target>${java.version}</target>
73-
<compilerArgs>
74-
<!-- Do not warn about using sun.misc.Unsafe -->
75-
<XDignore.symbol.file />
76-
</compilerArgs>
77-
<showWarnings>false</showWarnings>
78-
<fork>false</fork>
79-
</configuration>
80-
</plugin>
8165
<plugin>
8266
<groupId>com.sun.istack</groupId>
8367
<artifactId>istack-commons-maven-plugin</artifactId>
84-
<inherited>true</inherited>
8568
</plugin>
8669
<plugin>
8770
<groupId>org.codehaus.mojo</groupId>
8871
<artifactId>build-helper-maven-plugin</artifactId>
89-
<inherited>true</inherited>
9072
</plugin>
9173
<plugin>
9274
<groupId>org.apache.felix</groupId>
9375
<artifactId>maven-bundle-plugin</artifactId>
94-
<inherited>true</inherited>
9576
<extensions>true</extensions>
9677
<configuration>
9778
<instructions>
@@ -106,7 +87,6 @@
10687
</configuration>
10788
</plugin>
10889
<plugin>
109-
<groupId>org.apache.maven.plugins</groupId>
11090
<artifactId>maven-surefire-plugin</artifactId>
11191
<configuration>
11292
<forkCount>2</forkCount>

0 commit comments

Comments
 (0)