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

Declare Spring modules with JDK 9 module metadata [SPR-13501] #18079

Open
spring-issuemaster opened this Issue Sep 24, 2015 · 8 comments

Comments

Projects
None yet
1 participant
@spring-issuemaster
Copy link
Collaborator

commented Sep 24, 2015

Juergen Hoeller opened SPR-13501 and commented

JDK 9's Jigsaw initiative aims to allow for module metadata (module-info.java) that can be added to framework and library jars while still keeping them compatible with JDK 8. Let's do this for Spring Framework 5.0's modules as far as feasible. However, we might not be able to express our optional dependency arrangement that way, in which case we might have to resort to an "automatic modules" approach for the more modest purposes of #18289.


Issue Links:

  • #18289 Stable module names for Spring Framework jars on JDK 9 module path ("depends on")
  • #17778 Upgrade core framework build to JDK 11 ("depends on")
  • #19148 Document Spring recommendations/restrictions for Java 9 module setups

1 votes, 12 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 15, 2016

Sam Brannen commented

Juergen Hoeller, is this issue a duplicate of #18289?

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 22, 2016

Juergen Hoeller commented

Not necessarily: This one is about shipping explicit module-info.java files in our own jars, and is rather unlikely to happen at this point since we cannot express optional dependencies that way. However, for the purposes of #18289, we could also aim for what Jigsaw calls "automatic modules", i.e. putting our regular jars onto the module path and letting them participate in a module-based arrangement that way (with implicit access to all other modules).

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 22, 2016

Sam Brannen commented

OK. I see the differences between the two issues now. Thanks for the clarification!

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 28, 2016

Juergen Hoeller commented

The Jigsaw page has just been updated with a proposal towards optional dependencies:
http://openjdk.java.net/projects/jigsaw/spec/issues/#CompileTimeDependences

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 17, 2017

Sam Brannen commented

while still keeping them compatible with JDK 9

Is that supposed to say "JDK 8"?

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 5, 2018

Grigory Kislin commented

Hello!
Are module-info.java planned to add in Spring 5.1, as was announced in video [Spring Framework 5.0 on JDK 8 & 9|https://www.youtube.com/watch?v=0-sbPBf81KA]? In recent 5.1.RC2 version they are missed.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 12, 2018

Juergen Hoeller commented

This issue is marked as "General Backlog", indicating that we won't deal with it for 5.1 (otherwise it'd be marked for 5.1 GA still) and probably not in subsequent 5.x releases either (otherwise it'd be marked as "5.x Backlog").

Specifically, we can't ship module-info files quite yet since we'd need stable module names for all of our optional dependencies... and many of those don't declare stable module names at this point (that is, they don't even include an Automatic-Module-Name manifest entry in their jar). Also, we'd need to build the entire framework on JDK 9+ for the compiler to understand the module-info.java format which is not entirely trivial either, even if the framework itself is known to work fine with JDK 9/10/11 at runtime.

All in all, my prediction about module-info files for 5.1 turned out to be too ambitious. Our current focus is on general JDK 11 compatibility (#20937) on the classpath and as automatic modules on the module path, as well as GraalVM compatibility (#21529). The use of jlink requires manual addition of module-info.class files to the framework jars for the time being... which might stay that way for several years still until we ship a JDK 11 baselined Spring Framework 6.0 against a new generation of dependencies.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 30, 2018

yboompook commented

I tried to jlink my project with moditect (maven plugin to add module-info to dependencies that don't have one), java-11. I pass throw lot's of problem and it still doen't work, however I think my work could help you to make it work in spring 6.

poc on github

stackoverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.