maven-bundle-plugin fails with "Invalid class file module-info.class"

Upgrading the bundle plugin to version 3.5.0 resolved the issue:

<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <version>3.5.0</version>
</plugin>

I also had to upgrade maven to 3.5, since the latest version of the plugin threw a NPE on maven 3.3:

Failed to execute goal org.apache.felix:maven-bundle-plugin:3.5.0:bundle (default-bundle) on project my-bundle: Execution default-bundle of goal org.apache.felix:maven-bundle-plugin:3.5.0:bundle failed. NullPointerException

See also FELIX-5698

UPDATE: Please check for the latest version of the bundle plugin at maven central. The latest version of maven can be found at their download page.


If you're using IntelliJ, this issue may appear despite your maven configuration being up to date because of this issue: https://youtrack.jetbrains.com/issue/IDEA-194358

The workaround is to turn off the Osmorc plugin