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

Please publish Automatic-Module-Name manifest entries #448

Closed
io7m opened this issue Dec 7, 2017 · 7 comments
Closed

Please publish Automatic-Module-Name manifest entries #448

io7m opened this issue Dec 7, 2017 · 7 comments

Comments

@io7m
Copy link

io7m commented Dec 7, 2017

Hello!

It'd be great if jgrapht published Automatic-Module-Name entries in the jar manifest for each module. This would assign the modules stable names to be used in (modular) Java 9 projects.

@jkinable
Copy link
Collaborator

jkinable commented Dec 7, 2017

Although I'm not familiar yet with Java 9 modules, this should be relatively easy (simply add one line to our pom files): http://branchandbound.net/blog/java/2017/12/automatic-module-name/
For the module name, I think org.jgrapht makes sense?
Any idea which POM files we should include this module name code (all?)?

@jkinable
Copy link
Collaborator

jkinable commented Dec 7, 2017

@io7m would you be willing to submit a pull request which takes care of this issue?

@io7m
Copy link
Author

io7m commented Dec 14, 2017

Hi.

Apologies, it seems like your response got buried in amongst all of the noise I receive from GitHub. I can certainly submit a PR that should address your questions.

io7m added a commit to io7m/jgrapht that referenced this issue Dec 14, 2017
This places all dependency and plugin version information into the
parent POM. It also updates (most) plugins to their latest published
versions in preparation for JDK 9 modularization.

The project does not yet build on JDK 9 due to the presence of the
now obsolete javax.annotation.Generated annotation.

Affects jgrapht#448
io7m added a commit to io7m/jgrapht that referenced this issue Dec 14, 2017
This is part of the push to upgrade all dependencies to JDK 9
compatible versions. This particular upgrade is necessary to make
use of the Automatic-Module-Name entries added to Commons Lang in
version 3.6.

Affects jgrapht#448
@io7m
Copy link
Author

io7m commented Dec 14, 2017

@jkinable Would you be opposed to requiring JDK 9 to build the project? This would be strictly limited to building from source; the project would still only require JDK 8 to run.

There are two reasons to do this:

  1. JDK 9 has a -release flag which performs checks of API usage. For example, if you were using JDK 8 and were wanting to produce JDK 6 bytecode, you could specify -source 1.6 and -target 1.6, but nothing would stop you accidentally using APIs that were only present in JDK 8. This would come as a nasty shock when people actually running a 1.6 VM tried to run your code. The -release flag prevents the above from happening; you are statically prevented from using any API that is not present in the targeted release.

  2. The project doesn't currently build on JDK 9 at all due to the use of the obsolete javax.annotation.Generated annotation. There's a workaround for this, but in my opinion, it's less pleasant than just requiring JDK 9 up-front and using the new JDK 9-specific equivalent (javax.annotation.processing.Generated).

@io7m
Copy link
Author

io7m commented Dec 14, 2017

To clarify: I originally mentioned adding Automatic-Module-Name entries, but I think that full modularization is possible once a couple of your dependencies have been updated.

io7m added a commit to io7m/jgrapht that referenced this issue Dec 14, 2017
This sets the following module names:

  jgrapht-core → org.jgrapht.core
  jgrapht-ext  → org.jgrapht.ext
  jgrapht-io   → org.jgrapht.io

This gives the modules stable names in preparation for possible full
modularization.

Affects jgrapht#448
io7m added a commit to io7m/jgrapht that referenced this issue Dec 14, 2017
This switches to using the new parameter names for version 3.0.0
of the JavaDoc plugin.

Affects jgrapht#448
io7m added a commit to io7m/jgrapht that referenced this issue Dec 15, 2017
This sets the following module names:

  jgrapht-core → org.jgrapht.core
  jgrapht-ext  → org.jgrapht.ext
  jgrapht-io   → org.jgrapht.io

This gives the modules stable names in preparation for possible full
modularization.

Affects jgrapht#448
@jkinable
Copy link
Collaborator

@io7m the issue with the javax.annotation.Generated has been fixed. The project now builds correctly using JDK9. It still seems a little early to enforce JDK9 to build the project (after all, JDK9 was only officially released a few months ago). Would it be possible to implement the full modularization without requiring JDK9?

@io7m
Copy link
Author

io7m commented Dec 19, 2017

@jkinable Yes, modularization is possible without requiring JDK 9, it's just slightly more complicated. Not a problem!

io7m added a commit to io7m/jgrapht that referenced this issue Feb 11, 2018
This sets the following module names:

  jgrapht-demo       → org.jgrapht.demo
  jgrapht-touchgraph → org.jgrapht.touchgraph

This gives the modules stable names in preparation for possible full
modularization.

Affects jgrapht#448
io7m added a commit to io7m/jgrapht that referenced this issue Feb 11, 2018
This upgrades JMH to the latest available version. It required a
small code change to match the new API. This update primarily exists
because the old version of JMH placed @generated annotations in the
generated code, and these no longer exist on JDK 9.

Affects jgrapht#448
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

No branches or pull requests

3 participants