我在我的 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>
我正在尝试在 module-info.java 中添加此依赖项,如下所示:
module io.github.wildcraft.restclient {
requires httpcore; // no compilation problem
requires httpclient; // no compilation problem
requires commons-io; // shows compilation error
}
对于 commons-io,我收到编译错误。我怎样才能使这项工作?