Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@duponter

Description

@duponter

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions