Assertj-core: Incorrect `module-info.class` included in the binary distribution of assertj-core

Created on 26 Feb 2019  路  7Comments  路  Source: assertj/assertj-core

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.

bug

Most helpful comment

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

All 7 comments

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

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}

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

Would you need a service pack release for that ?

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

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

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

Was this page helpful?
0 / 5 - 0 ratings