-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Pact java libraries are incompatible with java 9+ modules #1055
Comments
I've been using Java 12 without issues, but not Gradle 6. But I'll rename the module names to remove the hyphens. |
Using underscores seems to work:
|
But I think all the modules and dependencies of this project need to be re-visited, but that would have to be for 4.1.x |
Great, thank you very much @uglyog - this interim solution will help us a lot. Do you have an idea of when this will be released (4.0.9?) and pushed to maven central? |
Version 4.0.9 released. |
We are attempting to utilize Pact in a project which is based on java11 (java 11, gradle 6, JUnit 5 + Jupiter) and utilizes some a jigsaw module which is only within java 11 (
requires java.net.http
), and unfortunately we are stuck.Upon further investigation (here is a useful article on DZone), it appears that the MANIFEST.MF for all of the java pact libraries includes an explicit entry to define an 'Automatic-Module-Name' per the following code:
See an example offending line of code in build.gradle currently in master on line 110:
'Automatic-Module-Name': project.group + "." + project.name
The problem is that the project.name includes hyphens, which are not allowed to be in java module names. Thus, whenever you try to include any of these Pact jars within a project which is built with Java 9 or higher, it fails.
A quick way to validate this problem is to execute the following command on any of the Pact library jars (see example command/output):
A potential quick fix (before actually creating module-info.java descriptors for these libraries) could be to stop explicitly including the invalid 'Automatic-Module-Name' within the builds for these jars. I have not attempted to build any of the Pact libraries myself using Java 9+, however if I manually remove that 'Automatic-Module-Name' line from the embedded generated manifest file in the above jar, it stops complaining:
If anyone has some thoughts on a work-around for utilizing Pact to test project which must be built with Java 9 or higher, I would welcome the thoughts
The text was updated successfully, but these errors were encountered: