我正在使用Maven将一个应用程序打成jar文件。但是,当我从Maven中获取jar插件仓库并在终端中运行以下三个命令时:
mvn clean
mvn compile
mvn package
在运行“mvn package”命令时,我遇到了以下错误。 错误信息:
Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.1.0:jar (default-jar) on project A2ATest2: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:3.1.0:jar failed: Plugin org.apache.maven.plugins:maven-jar-plugin:3.1.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-jar-plugin:jar:3.1.0 -> org.apache.maven:maven-archiver:jar:3.2.0: Failed to read artifact descriptor for org.apache.maven:maven-
archiver:jar:3.2.0: Could not transfer artifact org.apache.maven:maven-archiver:pom:3.2.0 from/to central (https://repo.maven.apache.org/maven2): No such host is known (
repo.maven.apache.org) -> [Help 1]
然而,当我使用2.4版本而不是3.1.0版本时,它可以正常工作。我不确定是否是一个bug,还是我做错了什么。再次感谢你的帮助。
找不到此主机...
- khmarbaise