Skip to content

Commit

Permalink
MCOMPILER-579 allow module-version configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mguillem committed Dec 19, 2024
1 parent fdebd58 commit d2ced6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
@Parameter(property = "maven.compiler.release")
protected String release;

/**
* The {@code --module-version} argument for the Java compiler.
* This is ignored if not applicable, e.g., in non-modular projects.
*
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-module-version">javac --module-version</a>
* @since 3.13.1
*/
@Parameter(property = "moduleVersion", defaultValue = "${project.version}")
protected String moduleVersion;

/**
* The {@code -encoding} argument for the Java compiler.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ protected void preparePaths(Set<File> sourceFiles) {
}

compilerArgs.add("--module-version");
compilerArgs.add(getProject().getVersion());
compilerArgs.add(moduleVersion);

} catch (IOException e) {
getLog().warn(e.getMessage());
Expand Down

0 comments on commit d2ced6f

Please sign in to comment.