Skip to content
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

Hyphen module name breaks module based projects #321

Closed
qballed opened this issue Nov 27, 2020 · 3 comments · Fixed by #323
Closed

Hyphen module name breaks module based projects #321

qballed opened this issue Nov 27, 2020 · 3 comments · Fixed by #323

Comments

@qballed
Copy link

qballed commented Nov 27, 2020

As per the JSE 9+ specs;

https://docs.oracle.com/javase/specs/jls/se9/html/jls-7.html#jls-ModuleDeclaration
https://docs.oracle.com/javase/specs/jls/se9/html/jls-3.html#jls-3.8

A module/package identifier, within the module descriptor(module-info.java) needs to be an alphanumeric string. The suggested workaround for module based projects is to use a period in place of the hyphen, for the "Automatic-Module-Name" in the manifest as such:

Automatic-Module-Name: de.gsi.chart.chartfx.chart

Further info on module resolution:

https://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleFinder.html

Love your work.

@wirew0rm
Copy link
Member

Thank you for the report, we just reused our artifact id's without giving it enough thought.

As we do not have any modularized applications using chartfx: is this "just" a spec violation or does this actually stop you from using this in your module-info.java? Should be fixed anyway of course, but if users could already be using the current non-conforming module name, we should communicate this differently.

@qballed
Copy link
Author

qballed commented Nov 27, 2020

Dependent applications wont compile so it's more than just a spec violation. This is the following javac error on both Oracle 11.0.7 and OpenJDK-11.0.3.

error: cannot access module-info
cannot resolve modules

Amending the manifest as per above works fine.

wirew0rm added a commit that referenced this issue Nov 27, 2020
Module names should not contain hyphens, so we cannot reuse our artifact
names. Instead introduce a new property which will be set in each
module.

fixes #321
@wirew0rm
Copy link
Member

Thanks for the clarification, prepared a pull request which will be merged as soon as CI passes.

wirew0rm added a commit that referenced this issue Nov 27, 2020
Module names should not contain hyphens, so we cannot reuse our artifact
names. Instead introduce a new property which will be set in each
module.

fixes #321
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 a pull request may close this issue.

2 participants