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

Add an automatic module name #67

Closed
carlosame opened this issue May 16, 2019 · 3 comments
Closed

Add an automatic module name #67

carlosame opened this issue May 16, 2019 · 3 comments
Assignees
Milestone

Comments

@carlosame
Copy link
Contributor

carlosame commented May 16, 2019

While I'm not an enthusiast of Java modularization, unfortunately Java libraries that aren't module-aware are increasingly being a source of compiler warnings as people migrate to newer JDKs.

It would help if dom4j set up an automatic module name in the Jar manifest, like:

Automatic-Module-Name: org.dom4j

I'm not familiar with gradle, but apparently the following would work:

jar {
  manifest {
    attributes('Automatic-Module-Name': 'org.dom4j')
  }
}

See https://guides.gradle.org/building-java-9-modules/#optional_add_code_automatic_module_name_code_manifest_entries_for_all_other_projects

Of course that a full module-info would also be a good thing, but the above solution is simple and solves the main issue of having to rely on generated module names.

@FilipJirsak FilipJirsak self-assigned this May 16, 2019
@FilipJirsak FilipJirsak added this to the 2.1.2 milestone May 16, 2019
@ColonelBlimp
Copy link

Can I up-vote this one 👍

@carlosame
Copy link
Contributor Author

This issue was marked for 2.1.2, but 2.1.2/2.1.3 went out without it so I prepared a pull request. It is tested and gives the desired result.

@reinhapa
Copy link

@FilipJirsak as a OpenJDK contributor I can definitively support this PR as it should be good practice to supply at least the Automatic-Module-Name in not jet modular libraries in order to have a stable library identification as explained here

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

No branches or pull requests

4 participants