Any plans for Java 9 Jigsaw (module) of Spring projects?
Asked Answered
I

3

6

Java 9 is scheduled to be released soon (July 27). Are there any plans to release a Java 9 compliant version of Spring projects that will be modular (Java 9 project Jigsaw)?

Idiotism answered 28/4, 2017 at 16:38 Comment(2)
Please ask directly to spring team via github: They are working on it : github.com/spring-projects/spring-boot/issues/7226Soutane
Possible duplicate of Do I need Spring 5 for Java 9?Overwhelming
S
4

Spring 5, the next major version of Spring, won't be modular. However you can use Spring 5 jars/artifacts as automatic modules in your module-info files. See official blogpost and What's new annoucement.

Sectarianize answered 18/5, 2017 at 20:31 Comment(1)
Yes, you can use jars/artifacts as automatic modules, but you cannot use "jlink" on the compiled modules, because jlink doesn't support automatic modules ...Lona
I
4

Conserning module-info.java see Declare Spring modules with JDK 9 module metadata issue last commit:

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 (SPR-16391) on the classpath and as automatic modules on the module path, as well as GraalVM compatibility (SPR-16991). 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.

Inflationism answered 12/9, 2018 at 10:19 Comment(0)
M
0

Update For 11/3/2022

from Juergen Hoeller in #18079

Our strategic alignment with the module system has been in competition with our AOT and GraalVM native image efforts in 6.0, so we unfortunately had no chance to experiment with a build migration to full module descriptors yet. There have been very few requests for it even in the course of this year, so we wonder whether there is much practical value to be uncovered here for the time being anyway. Looking forward, the use of jlink's module-bounded approach for application/framework-level modules might get superseded by runtime images based on GraalVM-style individual reachability analysis in the long run.

That said, OpenJDK's Project Leyden aims to reuse module system concepts and tools for its standardized static image approach, so deeper module system alignment remains part of our long-term technology strategy for the Spring Framework 6.x generation.

Microsome answered 3/11, 2022 at 16:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.