You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was discussed in passing in a few other issues, but I'd rather have one place to track it.
We feed our whole classpath to jdeps to find which platform modules we need. jdeps, however, requires the modules to form a coherent dependency graph with no missing dependencies. This was the reason for jlinkModules fails for modules that require automatic modules #1293. More recently, I've had a similar thing happen because HikariCP added a module descriptor that requires a lot of dependencies it doesn't bring in through its POM, which makes jdeps fail like this:
$ jdeps -R --multi-release 11 HikariCP-3.4.5.jar
Exception in thread "main" java.lang.module.FindException: Module micrometer.core not found, required by com.zaxxer.hikari
at java.base/java.lang.module.Resolver.findFail(Resolver.java:877)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:191)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:140)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:422)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:256)
at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration.<init>(JdepsConfiguration.java:117)
at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:563)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:589)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:543)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:519)
at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)
Note that this can't be dealt with using jlinkIgnoreMissingDependencies! There are other workarounds (e.g. micromanaging jlinkBuildImage / fullClassPath), but using those is annoying, it subtly breaks jlinkModules, and it doesn't have anything to do with building an image.
jlinkIgnoreMissingDependencies is annoying. It's a remnant of the first iteration of JlinkPlugin, before we restricted it to only platform modules (JlinkPlugin: restrict linking to platform modules #1248), and I didn't find much use for it so far except for finding missing Jakarta API dependencies. I think this dependency check should be restricted to platform modules/packages only.
Here's a helper plugin I've hacked together to simplify dealing with this stuff: https://gist.github.com/nigredo-tori/3b168da8e3cdcc7766ace3f23e999ec5 . These tweaks can't be adopted into this project as they are - mostly because they use Java 11 - but it should hopefully be useful as a starting point for solving the issues above.
The text was updated successfully, but these errors were encountered:
This was discussed in passing in a few other issues, but I'd rather have one place to track it.
jdeps
to find which platform modules we need.jdeps
, however, requires the modules to form a coherent dependency graph with no missing dependencies. This was the reason for jlinkModules fails for modules that require automatic modules #1293. More recently, I've had a similar thing happen because HikariCP added a module descriptor thatrequire
s a lot of dependencies it doesn't bring in through its POM, which makesjdeps
fail like this:jlinkIgnoreMissingDependencies
! There are other workarounds (e.g. micromanagingjlinkBuildImage / fullClassPath
), but using those is annoying, it subtly breaksjlinkModules
, and it doesn't have anything to do with building an image.jlinkIgnoreMissingDependencies
is annoying. It's a remnant of the first iteration ofJlinkPlugin
, before we restricted it to only platform modules (JlinkPlugin: restrict linking to platform modules #1248), and I didn't find much use for it so far except for finding missing Jakarta API dependencies. I think this dependency check should be restricted to platform modules/packages only.Here's a helper plugin I've hacked together to simplify dealing with this stuff: https://gist.github.com/nigredo-tori/3b168da8e3cdcc7766ace3f23e999ec5 . These tweaks can't be adopted into this project as they are - mostly because they use Java 11 - but it should hopefully be useful as a starting point for solving the issues above.
The text was updated successfully, but these errors were encountered: