Skip to content

Commit 1a94bbc

Browse files
lhotarieolivelli
authored andcommitted
[Build] Specify release in maven-compiler-plugin configuration on JDK11 (apache#10343)
* Specify release in maven-compiler-plugin configuration * Use "8" instead of "1.8" (cherry picked from commit e5a2c5f)
1 parent c96e31f commit 1a94bbc

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

pom.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ flexible messaging model and an intuitive client API.</description>
7474
</issueManagement>
7575

7676
<properties>
77+
<maven.compiler.source>8</maven.compiler.source>
78+
<maven.compiler.target>8</maven.compiler.target>
79+
7780
<!--config keys to congiure test selection -->
7881
<include>*</include>
7982
<exclude/>
@@ -1505,13 +1508,30 @@ flexible messaging model and an intuitive client API.</description>
15051508

15061509
<profiles>
15071510
<profile>
1508-
<id>jdk11-tests</id>
1511+
<id>jdk11</id>
15091512
<activation>
15101513
<jdk>[11,)</jdk>
15111514
</activation>
15121515
<properties>
1516+
<!-- prevents silent NoSuchMethodErrors that happen at runtime on Java 8 -->
1517+
<!-- see https://github.com/apache/pulsar/issues/8445 -->
1518+
<maven.compiler.release>${maven.compiler.target}</maven.compiler.release>
1519+
<!-- required for running tests on JDK11+ -->
15131520
<test.additional.args> --add-opens java.base/jdk.internal.loader=ALL-UNNAMED </test.additional.args>
15141521
</properties>
1522+
<build>
1523+
<pluginManagement>
1524+
<plugins>
1525+
<plugin>
1526+
<artifactId>maven-compiler-plugin</artifactId>
1527+
<configuration>
1528+
<!-- for some reason, setting maven.compiler.release property alone doesn't work -->
1529+
<release>${maven.compiler.release}</release>
1530+
</configuration>
1531+
</plugin>
1532+
</plugins>
1533+
</pluginManagement>
1534+
</build>
15151535
</profile>
15161536
<profile>
15171537
<id>coverage</id>

0 commit comments

Comments
 (0)