maven-java9-jigsaw icon indicating copy to clipboard operation
maven-java9-jigsaw copied to clipboard

How to Use External Dependencies

Open nicklee1990 opened this issue 7 years ago • 2 comments

How would you go about incorporating an external dependency into one of your modules? For example lets say you used a Math dependency in one of your implementations:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-math3</artifactId>
    <version>3.2</version>
</dependency>

With this added to your POM, would your run command still work? I've used your project as a template for a playground project and I'm getting a java.lang.module.FindException: Module XXXXX not found, required by ....

In my module-info.java for the service provider provider I require the non-modular dependency

nicklee1990 avatar May 19 '17 19:05 nicklee1990

I have the same issue, any workarounds?

rudolfschmidt avatar Dec 29 '17 09:12 rudolfschmidt

While this is very late, but relevant, you can "require" non-modular jars by their jar name. That is considered as "depending on a module with automatic name" image

Dragas avatar May 20 '20 04:05 Dragas