Skip to content

Commit e55200e

Browse files
committed
Fix java source and target version properties
Those properties are defined on the parent POM, inherited from maven-parent. They are passed through to the forked maven on the command line by the failsafe plugin. The current workaround is to remove those properties (and fix configuration for enforcer-plugin).
1 parent 90f58dc commit e55200e

File tree

15 files changed

+30
-44
lines changed

15 files changed

+30
-44
lines changed

pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ under the License.
100100
<maven4x.site.path>plugins-archives/${project.artifactId}-LATEST-4.x</maven4x.site.path>
101101
<!-- 4.x publish -->
102102
<maven.site.path>${maven4x.site.path}</maven.site.path>
103+
104+
<maven.compiler.source />
105+
<maven.compiler.target />
106+
<maven.compiler.release>17</maven.compiler.release>
107+
<minimalJavaBuildVersion>${maven.compiler.release}</minimalJavaBuildVersion>
108+
103109
</properties>
104110

105111
<dependencies>
@@ -215,6 +221,29 @@ under the License.
215221
</plugin>
216222
</plugins>
217223
</pluginManagement>
224+
<plugins>
225+
<plugin>
226+
<groupId>org.apache.maven.plugins</groupId>
227+
<artifactId>maven-enforcer-plugin</artifactId>
228+
<executions>
229+
<execution>
230+
<id>enforce-bytecode-version</id>
231+
<goals>
232+
<goal>enforce</goal>
233+
</goals>
234+
<configuration>
235+
<rules>
236+
<enforceBytecodeVersion>
237+
<maxJdkVersion>${maven.compiler.release}</maxJdkVersion>
238+
</enforceBytecodeVersion>
239+
</rules>
240+
<fail>true</fail>
241+
</configuration>
242+
</execution>
243+
</executions>
244+
245+
</plugin>
246+
</plugins>
218247
</build>
219248

220249
<profiles>

src/it/MCOMPILER-366/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
<artifactId>maven-compiler-plugin</artifactId>
5454
<version>@project.version@</version>
5555
<configuration>
56-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
57-
<source />
58-
<target />
5956
<release>17</release>
6057
</configuration>
6158
</plugin>

src/it/MCOMPILER-481-requires-static-included/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ under the License.
4141
<artifactId>maven-compiler-plugin</artifactId>
4242
<version>@project.version@</version>
4343
<configuration>
44-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
45-
<source />
46-
<target />
4744
<release>11</release>
4845
<!-- Older release required by the surefire plugin tested below. -->
4946
</configuration>

src/it/automodules-application/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
<artifactId>maven-compiler-plugin</artifactId>
4646
<version>@project.version@</version>
4747
<configuration>
48-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
49-
<source />
50-
<target />
5148
<release>17</release>
5249
</configuration>
5350
</plugin>

src/it/automodules-library/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
<artifactId>maven-compiler-plugin</artifactId>
4646
<version>@project.version@</version>
4747
<configuration>
48-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
49-
<source />
50-
<target />
5148
<release>17</release>
5249
</configuration>
5350
</plugin>

src/it/automodules-manifest/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
<artifactId>maven-compiler-plugin</artifactId>
4545
<version>@project.version@</version>
4646
<configuration>
47-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
48-
<source />
49-
<target />
5047
<release>17</release>
5148
</configuration>
5249
</plugin>

src/it/automodules-transitive-module/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
<artifactId>maven-compiler-plugin</artifactId>
4646
<version>@project.version@</version>
4747
<configuration>
48-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
49-
<source />
50-
<target />
5148
<release>17</release>
5249
</configuration>
5350
</plugin>

src/it/jdk9-exportsto/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
<artifactId>maven-compiler-plugin</artifactId>
4343
<version>@project.version@</version>
4444
<configuration>
45-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
46-
<source />
47-
<target />
4845
<release>17</release>
4946
</configuration>
5047
</plugin>

src/it/jpms_add-exports/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
<artifactId>maven-compiler-plugin</artifactId>
3737
<version>@project.version@</version>
3838
<configuration>
39-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
40-
<source />
41-
<target />
4239
<release>17</release>
4340
<compilerArgs>
4441
<arg>--add-exports</arg>

src/it/jpms_compile-main-empty-test-bar/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
<artifactId>maven-compiler-plugin</artifactId>
4646
<version>@project.version@</version>
4747
<configuration>
48-
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
49-
<source />
50-
<target />
5148
<release>17</release>
5249
</configuration>
5350
</plugin>

0 commit comments

Comments
 (0)