failsafe-lib / failsafe

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

Support Java Modules #358

Closed aalmiray closed 1 year ago

aalmiray commented 1 year ago

Follow up to #295

v2.4.4 defines an automatic module name

$ jarviz module name --file failsafe-2.4.4.jar 
subject: failsafe-2.4.4.jar
name: net.jodah.failsafe
source: manifest
automatic: true
valid: true

$ jarviz module descriptor --file failsafe-2.4.4.jar 
subject: failsafe-2.4.4.jar
name: net.jodah.failsafe
version: 2.4.4
open: false
automatic: true
requires:
  java.base mandated
contains:
  net.jodah.failsafe
  net.jodah.failsafe.event
  net.jodah.failsafe.function
  net.jodah.failsafe.internal
  net.jodah.failsafe.internal.util
  net.jodah.failsafe.util.concurrent

I'd be great if the library supplied a full Java module descriptor. It's possible to keep bytecode baseline compatible with Java 8 while providing a full module descriptor thanks to ModiTect. This will help modular projects that consume failsafe, specifically those that create custom Java Runtimes with jlink, as the latter does not support automatic modules but explicit modules. If interested I can send a PR to make it happen.

jhalterman commented 1 year ago

Hi @aalmiray - Thanks for the interest and for filing this. A PR for this would be great!