module-info.java from com.google.gson included in nimbus-jose-jwt.jar from version 9.24
The class module-info.java should not be packed into the jar by the dependency com.google.gson, this leads to problems with Java 11.
The problem should be solved with the following patch:
--- pom.xml 2022-10-11 10:20:47.704000000 +0200
+++ pom.xml 2022-10-11 10:21:26.745225300 +0200
@@ -157,6 +157,9 @@
<relocation>
<pattern>com.google.gson</pattern>
<shadedPattern>com.nimbusds.jose.shaded.gson</shadedPattern>
+ <excludes>
+ <exclude>module-info.class</exclude>
+ </excludes>
</relocation>
</relocations>
<artifactSet>
Comments (12)
-
-
- changed status to resolved
Fixed in 896a6776 , released as version 9.25.5 (2022-10-11).
-
Sorry, but it is still present in 9.25.5
-
Also still present in 9.25.6
-
In a private message I suggested using
<filters>
(which I know to work in a different project):<relocations> <relocation> <pattern>com.google.gson</pattern> <shadedPattern>com.nimbusds.jose.shaded.gson</shadedPattern> </relocation> </relocations> <filters> <filter> <artifact>com.google.code.gson:gson</artifact> <excludes> <exclude>**/module-info.class</exclude> <!-- not sure if we need **/ --> </excludes> </filter> </filters>
See docs: https://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html#filters
If a fix really works can btw easily be verified by unzipping the produced jar.
-
9.31
still contains this. Will we ever get rid of this? -
@Arjan Tijms Would you be able to submit a PR with a fix? We don’t use modules here and I don’t know what could be done about that.
-
Thanks for asking, I’m going to try for sure.
-
- changed status to open
Thanks
-
Here is a PR, applying the fix I suggested above (coincidentally exactly one year ago ) https://bitbucket.org/connect2id/nimbus-jose-jwt/pull-requests/110
-
Thank you! The PR is merged now and I’m marking the issue as closed, hopefully once and for all
version 9.37.1 (2023-11-08) * The module-info.java from the shaded Gson dependency must not be packed into the published JAR (iss #496).
-
- changed status to resolved
Fixed in version 9.37.1 (2023-11-08)
- Log in to comment
Thanks for the report and patch!