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

Incorrect module-info.class included in the binary distribution of assertj-core #1448

Closed
JaroKuruc opened this issue Feb 26, 2019 · 7 comments
Labels
type: bug A general bug
Milestone

Comments

@JaroKuruc
Copy link

Summary

Distribution jar assertj-core-3.12.0.jar contains invalid module-info.class in META-INF/versions/9. Content of module-info.class names the module as net.bytebuddy which is in conflict with declared Automatic-Module-Name: org.assertj.core in MANIFEST.MF. It also exports internal classes from org.assertj.core.internal.bytebuddy package.

@joel-costigliola
Copy link
Member

Thanks for reporting this !
Would you know what would be the correct module-info ?

@joel-costigliola joel-costigliola added the type: bug A general bug label Feb 26, 2019
@JaroKuruc
Copy link
Author

There should be no module-info as you are building against JDK8 and declaring stable Automatic-Module-Name.

The problem is that maven-shade-plugin is not filtering module-info from bytebuddy dependency. A fix is to add the following to its configuration.

<filters>
  <filter>
    <artifact>*:*</artifact>
    <excludes><exclude>META-INF/versions/**</exclude></excludes>
  </filter>
</filters>

It will also fix few warnings produced during the build.

[INFO] --- maven-bundle-plugin:4.1.0:bundle (bundle-after-unpack-shaded) @ assertj-core ---
[INFO] Unable to determine whether the meta annotation edu.umd.cs.findbugs.annotations.SuppressFBWarnings applied to type org.assertj.core.internal.bytebuddy.ClassFileVersion$VersionLocator$CreationAction provides bundle annotations as it is not on the project build path. If this annotation does provide bundle annotations then it must be present on the build path in order to be processed
[WARNING] Bundle org.assertj:assertj-core:bundle:3.12.1-SNAPSHOT : Split package, multiple jars provide the same package:META-INF/versions/9
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in   [Jar:., Jar:byte-buddy]
Class path         [Jar:., Jar:junit, Jar:junit-jupiter-api, Jar:apiguardian-api, Jar:junit-platform-commons, Jar:opentest4j, Jar:hamcrest-core, Jar:byte-buddy]
[WARNING] Bundle org.assertj:assertj-core:bundle:3.12.1-SNAPSHOT : Classes found in the wrong directory: {META-INF/versions/9/module-info.class=module-info}

@joel-costigliola
Copy link
Member

Thanks @JaroKuruc the jar does not contain any module-info.

Would you need a service pack release for that ?

@JaroKuruc
Copy link
Author

@joel-costigliola Yes, a service pack release would be nice.

@victornoel
Copy link

@joel-costigliola I second this, assertj imports are broken in Eclipse editors with 3.12.0 (but everything compiles and run fine though)

@joel-costigliola
Copy link
Member

assertj-core 3.12.1 has been released, should be in maven central shortly.

@joel-costigliola joel-costigliola added this to the 3.12.1 milestone Feb 28, 2019
@joel-costigliola
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants