failsafe-lib / failsafe

Fault tolerance and resilience patterns for the JVM
https://failsafe.dev
Apache License 2.0
4.17k stars 296 forks source link

Using Failsafe as a JPMS module generates warning during Maven build #295

Closed duponter closed 3 years ago

duponter commented 3 years ago

When using Failsafe as a dependency in a JPMS compliant application, following warning is issued by Apache Maven 3.8.1 during compilation (using Java version: 11.0.11, vendor: AdoptOpenJDK)

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ matis-infrastructure --- [INFO] Required filename-based automodules detected: [failsafe-2.4.3.jar]. Please don't publish this project to a public artifact repository!

Additionally to add the Failsafe dependency in the project's pom file, an entry has to be added to the project's module-info.java. requires failsafe;

As Failsafe is already OSGi compliant, it is very easy to prevent the aforementioned warning and additionally reserve the same module name as the one already used in OSGi: net.jodah.failsafe. It merely requires to add the following entry to the leveraged manifest.mf. (I will submit a PR very soon) Automatic-Module-Name: net.jodah.failsafe

After applying these changes, the Failsafe entry in module-info.java needs to be changed to: requires net.jodah.failsafe;

jhalterman commented 3 years ago

Fixed by #296.