-1

我想在我的项目中使用 ws4j。而且我一直无法连接到互联网。因此,大多数时候我使用dependency:get命令将依赖项下载到本地存储库。然后我在项目中使用它。
就像我尝试下载ws4j-1.0.1一样。但是我在下载时遇到错误。它说Missing POM for edu.cmu.lti:ws4j:jar:1.0.1。但是存储库中有一个 pom 文件。请参阅 url ws4j 存储库。但为什么我得到错误。

我使用的命令是mvn dependency:get -Dartifact=edu.cmu.lti:ws4j:1.0.1

我得到的错误图像

错误图片

我正在使用 Maven版本 3.6.3

请有人帮忙解决这个问题。

4

1 回答 1

1

mvn 依赖:get -Dartifact=edu.cmu.lti:ws4j:1.0.1

这会尝试从https://repo.maven.apache.org/maven2/下载依赖项,并且由于它没有在那里找到依赖项,所以它失败了。您需要指定“ -DremoteRepositories ”以从远程存储库中获取它。

例如:mvn 依赖:get -Dartifact=org.apache.maven:maven-core:2.2.1:jar:sources -DremoteRepositories=https://repo.maven.apache.org/maven2 -Ddest=/tmp/myfile 。罐

请参考https://maven.apache.org/plugins/maven-dependency-plugin/usage.html

于 2020-08-20T14:55:26.507 回答