Skip to content

Commit 236fc26

Browse files
authored
Fix java source and target version properties (#982)
* 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). * Remove empty element
1 parent b7ad2b8 commit 236fc26

File tree

15 files changed

+33
-44
lines changed

15 files changed

+33
-44
lines changed

pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ under the License.
103103
<version.maven-invoker-plugin>3.9.1</version.maven-invoker-plugin>
104104
<!-- 4.x publish -->
105105
<maven.site.path>${maven4x.site.path}</maven.site.path>
106+
107+
<maven.compiler.source />
108+
<maven.compiler.target />
109+
<maven.compiler.release>17</maven.compiler.release>
110+
<minimalJavaBuildVersion>${maven.compiler.release}</minimalJavaBuildVersion>
111+
106112
</properties>
107113

108114
<dependencies>
@@ -216,6 +222,33 @@ under the License.
216222
</excludes>
217223
</configuration>
218224
</plugin>
225+
<plugin>
226+
<groupId>org.apache.maven.plugins</groupId>
227+
<artifactId>maven-pmd-plugin</artifactId>
228+
<configuration>
229+
<targetJdk>${maven.compiler.release}</targetJdk>
230+
</configuration>
231+
</plugin>
232+
<plugin>
233+
<groupId>org.apache.maven.plugins</groupId>
234+
<artifactId>maven-enforcer-plugin</artifactId>
235+
<executions>
236+
<execution>
237+
<id>enforce-bytecode-version</id>
238+
<goals>
239+
<goal>enforce</goal>
240+
</goals>
241+
<configuration>
242+
<rules>
243+
<enforceBytecodeVersion>
244+
<maxJdkVersion>${maven.compiler.release}</maxJdkVersion>
245+
</enforceBytecodeVersion>
246+
</rules>
247+
<fail>true</fail>
248+
</configuration>
249+
</execution>
250+
</executions>
251+
</plugin>
219252
</plugins>
220253
</pluginManagement>
221254
</build>

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)