File tree 2 files changed +13
-3
lines changed
src/main/java/org/apache/maven/plugin/compiler
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ under the License.
28
28
</parent >
29
29
30
30
<artifactId >maven-compiler-plugin</artifactId >
31
- <version >3.13.1 -SNAPSHOT</version >
31
+ <version >3.14.0 -SNAPSHOT</version >
32
32
<packaging >maven-plugin</packaging >
33
33
34
34
<name >Apache Maven Compiler Plugin</name >
@@ -76,7 +76,7 @@ under the License.
76
76
<plexus-java .version>1.4.0</plexus-java .version>
77
77
<javaVersion >8</javaVersion >
78
78
<maven .it.failure.ignore>false</maven .it.failure.ignore>
79
- <project .build.outputTimestamp>2024-03-15T07:28:09Z </project .build.outputTimestamp>
79
+ <project .build.outputTimestamp>2025-02-13T18:15:32Z </project .build.outputTimestamp>
80
80
<invoker .junitPackageName>org.apache.maven.plugins.compiler.its</invoker .junitPackageName>
81
81
</properties >
82
82
Original file line number Diff line number Diff line change @@ -162,6 +162,16 @@ public class CompilerMojo extends AbstractCompilerMojo {
162
162
@ Parameter (defaultValue = "javac" )
163
163
private String debugFileName ;
164
164
165
+ /**
166
+ * The {@code --module-version} argument for the Java compiler.
167
+ * This is ignored if not applicable, e.g., in non-modular projects.
168
+ *
169
+ * @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-module-version">javac --module-version</a>
170
+ * @since 3.14.0
171
+ */
172
+ @ Parameter (property = "maven.compiler.moduleVersion" , defaultValue = "${project.version}" )
173
+ private String moduleVersion ;
174
+
165
175
final LocationManager locationManager = new LocationManager ();
166
176
167
177
private List <String > classpathElements ;
@@ -302,7 +312,7 @@ protected void preparePaths(Set<File> sourceFiles) {
302
312
}
303
313
304
314
compilerArgs .add ("--module-version" );
305
- compilerArgs .add (getProject (). getVersion () );
315
+ compilerArgs .add (moduleVersion );
306
316
307
317
} catch (IOException e ) {
308
318
getLog ().warn (e .getMessage ());
You can’t perform that action at this time.
0 commit comments