I have one module that provides two implementations of a interface. I am getting compile error 'Duplicate service entry: org.util.hsm.api.HSMService'. Both of implementations belong to same module.
module-info.java
module org.util.thales.hsm {
uses org.util.hsm.api.HSMService;
provides org.util.hsm.api.HSMService with org.util.hsm.thales.ThalesHSMService;
provides org.util.hsm.api.HSMService with org.util.hsm.safenet.SafeNetHSMService;
}
After a lot of trial and error, i found the solution.
module org.util.thales.hsm {
uses org.util.hsm.api.HSMService;
provides org.util.hsm.api.HSMService with org.util.hsm.thales.ThalesHSMService, org.util.hsm.safenet.SafeNetHSMService;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With