This is an automated email from the ASF dual-hosted git repository.
snuyanzin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new edbe964b628 [FLINK-38979][build] Enable flink-tests-java17 for jdk21
build
edbe964b628 is described below
commit edbe964b628a455c742b534f1324c8b8e9c93a96
Author: Sergey Nuyanzin <[email protected]>
AuthorDate: Mon Jan 26 23:33:41 2026 +0100
[FLINK-38979][build] Enable flink-tests-java17 for jdk21 build
---
flink-tests-java17/pom.xml | 11 +++++++++++
.../api/java/typeutils/runtime/RecordBuilderFactoryTest.java | 2 +-
pom.xml | 9 ++++++++-
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/flink-tests-java17/pom.xml b/flink-tests-java17/pom.xml
index 6a84be5afb2..8facb299517 100644
--- a/flink-tests-java17/pom.xml
+++ b/flink-tests-java17/pom.xml
@@ -33,6 +33,10 @@
<packaging>jar</packaging>
+ <properties>
+ <source.java.version>17</source.java.version>
+ </properties>
+
<dependencies>
<!-- For Java record (de)serialization -->
<dependency>
@@ -77,6 +81,13 @@
<suppressionsLocation>/tools/maven/suppressions-tests-java17.xml</suppressionsLocation>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${source.java.version}</source>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git
a/flink-tests-java17/src/test/java/org/apache/flink/api/java/typeutils/runtime/RecordBuilderFactoryTest.java
b/flink-tests-java17/src/test/java/org/apache/flink/api/java/typeutils/runtime/RecordBuilderFactoryTest.java
index 2e1436b843a..549ed86d092 100644
---
a/flink-tests-java17/src/test/java/org/apache/flink/api/java/typeutils/runtime/RecordBuilderFactoryTest.java
+++
b/flink-tests-java17/src/test/java/org/apache/flink/api/java/typeutils/runtime/RecordBuilderFactoryTest.java
@@ -107,6 +107,6 @@ class RecordBuilderFactoryTest {
assertThatThrownBy(builder::build)
.hasMessage("Could not instantiate record")
- .hasCause(new IllegalArgumentException());
+ .hasCauseInstanceOf(IllegalArgumentException.class);
}
}
diff --git a/pom.xml b/pom.xml
index 91bacb64b79..6f8b004424c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1145,7 +1145,9 @@ under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>17</source>
+ <!-- Use source here
which is 11 to fail fast in case of jdk12+ syntax use
+ since default is 17 and
CI compile task uses this profile -->
+
<source>${source.java.version}</source>
<target>17</target>
<compilerArgs
combine.children="append">
<arg>--add-exports=java.management/sun.management=ALL-UNNAMED</arg>
@@ -1185,6 +1187,11 @@ under the License.
<profile>
<id>java21-target</id>
+
+ <modules>
+ <module>flink-tests-java17</module>
+ </modules>
+
<build>
<plugins>
<plugin>