Skip to content

Commit 1ede6c6

Browse files
committed
Change test setup for jdk14/15 vs jdk16+
1 parent cc5d6ad commit 1ede6c6

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

pom.xml

+46-2
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,12 @@
216216
<skipTests>true</skipTests>
217217
</properties>
218218
</profile>
219+
<!-- 07-Dec-2021, tatu: This is a huge mess, sorry folks... -->
219220
<profile>
220221
<!-- Build Record tests using Java 14 if JDK is available -->
221-
<id>java14+</id>
222+
<id>java14-15</id>
222223
<activation>
223-
<jdk>[14,)</jdk>
224+
<jdk>[14,15]</jdk>
224225
</activation>
225226
<build>
226227
<plugins>
@@ -267,6 +268,49 @@
267268
</plugins>
268269
</build>
269270
</profile>
271+
<profile>
272+
<!-- And different set up for JDK 16+ -->
273+
<id>java16+</id>
274+
<activation>
275+
<jdk>[16,)</jdk>
276+
</activation>
277+
<build>
278+
<plugins>
279+
<plugin>
280+
<groupId>org.codehaus.mojo</groupId>
281+
<artifactId>build-helper-maven-plugin</artifactId>
282+
<executions>
283+
<execution>
284+
<id>add-test-source</id>
285+
<phase>generate-test-sources</phase>
286+
<goals>
287+
<goal>add-test-source</goal>
288+
</goals>
289+
<configuration>
290+
<sources>
291+
<source>src/test-jdk14/java</source>
292+
</sources>
293+
</configuration>
294+
</execution>
295+
</executions>
296+
</plugin>
297+
<plugin>
298+
<groupId>org.apache.maven.plugins</groupId>
299+
<artifactId>maven-compiler-plugin</artifactId>
300+
<inherited>true</inherited>
301+
<configuration>
302+
<optimize>true</optimize>
303+
<!-- Enable Java 17 for all sources so that Intellij picks the right language level -->
304+
<source>16</source>
305+
<release>16</release>
306+
<compilerArgs>
307+
<arg>-parameters</arg>
308+
</compilerArgs>
309+
</configuration>
310+
</plugin>
311+
</plugins>
312+
</build>
313+
</profile>
270314
<profile>
271315
<id>errorprone</id>
272316
<build>

0 commit comments

Comments
 (0)