Skip to content

Allow to not use --module-version for the Java compiler #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: maven-compiler-plugin-3.x
Choose a base branch
from

Conversation

pzygielo
Copy link
Contributor

@pzygielo pzygielo marked this pull request as ready for review May 26, 2025 12:27
@desruisseaux
Copy link
Contributor

Do we need to add a new useModuleVersion plugin configuration option? Couldn't the users set the existing moduleVersion configuration option to an empty value instead if they do not want module version? It would still require a change in the code, but would avoid increasing the number of plugin configuration options.

@pzygielo
Copy link
Contributor Author

Couldn't the users set the existing moduleVersion configuration option to an empty value instead if they do not want module version?

Let me explore that option. As long as the same goal is achieved I'm not attached to new parameter.

@pzygielo
Copy link
Contributor Author

Do we need to add a new useModuleVersion plugin configuration option? Couldn't the users set the existing moduleVersion configuration option to an empty value

Unclear how to preserve compatibility with current default of project.version (since 3.14). Using special value not conforming to ModuleDescriptor.Version could be considered, but I don't like that idea very much.

Thus I prefer proposed solution, but I'm open to see it being solved differently.

@desruisseaux
Copy link
Contributor

No special value, just allow users to specify <moduleVersion/>. The value is set to an empty or blank string, and the code just needs to test if (!moduleVersion.isEmpty()) { add the option }.

@pzygielo
Copy link
Contributor Author

With <moduleVersion/> project.version seems to be injected. So !moduleVersion.isEmpty would always be true unless default was removed.

@pzygielo
Copy link
Contributor Author

Then, I don't know how to differentiate the case of explicit empty or blank string set with <moduleVersion/> from the case this is not set at all, for the project.version to be used.

@desruisseaux
Copy link
Contributor

It may be a question for @gnodet: we have a configuration option declared that way:

@Parameter(property = "maven.compiler.moduleVersion", defaultValue = "${project.version}")
private String moduleVersion;

Do you know if it is possible for a user to explicitly set an empty value? Apparently, using <moduleVersion/> causes Maven to fallback on defaultValue. Is there a way to said "do not use the default"? (other than adding a new useMavenVersion plugin configuration option).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants