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

Build fails on undertow example with an error related to Multi-release module #70

Open
antoinesd opened this issue Oct 25, 2018 · 7 comments

Comments

@antoinesd
Copy link
Contributor

Building the project fails with following error:

Error: jboss-logging-3.2.1.Final.jar is a multi-release jar file but --multi-release option is not set

while boss-logging is not a multi-release module.

@gunnarmorling
Copy link
Member

Hey @antoinesd, so I think this is caused by the recently resolved issue #67. By default the generated module-info.class is located under META-INF/versions/9 now, which causes problems when subsequently using jdeps (as implicitly done by the generate-module-info / add-module-info goals). So it seems using META-INF/versions/9 by default turns out to not be a good idea, as it'd break the usage of ModiTect in many cases. Of course the value can still be given explicitly via the jvmVersion plug-in option. (CC @lukehutch)

@gunnarmorling
Copy link
Member

Resolved via #73.

@gunnarmorling gunnarmorling added this to the 1.0.0.Beta2 milestone Dec 16, 2018
@lukehutch
Copy link
Contributor

If a jarfile does not contain a Multi-Release: true entry in its manifest file, it is not a multi-release jar (confirmed with Alan Bateman), and anything in META-INF/versions/ should be ignored. Is the jdeps tool itself not honoring this?

@gunnarmorling
Copy link
Member

There is a bug in jdeps which prevents it from running with a mixture of MR JARs and non-MR JARs.

We run into this when adding module descriptors to existing JARs (typically dependencies you'd like to use in a jlink image). After adding a descriptor under META-INF/versions/9 to the first dependency, the jdeps call to subsequent ones (for creating the candidate descriptor) failse due to that. As I learned, this has been fixed in JDK 12 and also be backported to the upcoming 11.0.2 release, i.e. then things can be made working by passing the --multi-release=xyz option to the jdeps call.

@gunnarmorling
Copy link
Member

So I'll reopen this and assign to the next release, making sure we pass the --multi-release option to the jdeps call if needed.

@whiskeysierra
Copy link

This seems to work with jdeps from JDK 11 and onwards. But then I'm having an issue when I try to produce a Java-9-compatible module-info, because moditect generates a module-info.class with a major version 55 (which is Java 11).

Is there a way to use a newer JDK to produce a Java-9 module-info.class?

@whiskeysierra
Copy link

Is there a way to use a newer JDK to produce a Java-9 module-info.class?

Nevermind. Setting jvmVersion to 9 works.

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

4 participants