I've included these dependencies in my Maven pom.xml:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
I am trying to add this dependency in module-info.java like so:
module io.github.wildcraft.restclient {
requires httpcore; // no compilation problem
requires httpclient; // no compilation problem
requires commons-io; // shows compilation error
}
For commons-io, I receive a compilation error. How can I make this work?
commons.io
– Calcariferousof
– ChristensenAll non-alphanumeric characters ([^A-Za-z0-9]) in the module name are replaced with a dot ("."), all repeating dots are replaced with one dot, and all leading and trailing dots are removed.
– Techyjava.lang.module.ModuleFinder
I linked above – Christensenmvn dependency:resolve
will show you the module name per dependency when running with Java 9 – Flybynight