File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
src/main/java/org/apache/maven/plugin/compiler Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ under the License.
2828 </parent >
2929
3030 <artifactId >maven-compiler-plugin</artifactId >
31- <version >3.13.1 -SNAPSHOT</version >
31+ <version >3.14.0 -SNAPSHOT</version >
3232 <packaging >maven-plugin</packaging >
3333
3434 <name >Apache Maven Compiler Plugin</name >
@@ -76,7 +76,7 @@ under the License.
7676 <plexus-java .version>1.4.0</plexus-java .version>
7777 <javaVersion >8</javaVersion >
7878 <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>
8080 <invoker .junitPackageName>org.apache.maven.plugins.compiler.its</invoker .junitPackageName>
8181 </properties >
8282
Original file line number Diff line number Diff line change @@ -162,6 +162,16 @@ public class CompilerMojo extends AbstractCompilerMojo {
162162 @ Parameter (defaultValue = "javac" )
163163 private String debugFileName ;
164164
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+
165175 final LocationManager locationManager = new LocationManager ();
166176
167177 private List <String > classpathElements ;
@@ -302,7 +312,7 @@ protected void preparePaths(Set<File> sourceFiles) {
302312 }
303313
304314 compilerArgs .add ("--module-version" );
305- compilerArgs .add (getProject (). getVersion () );
315+ compilerArgs .add (moduleVersion );
306316
307317 } catch (IOException e ) {
308318 getLog ().warn (e .getMessage ());
You can’t perform that action at this time.
0 commit comments