繁体   English   中英

无法下载groovy.jar

[英]Unable to download groovy.jar

任何帮助表示赞赏。

我是Maven的新手。 我从教程中获得了以下命令

mvn archetype:generate -DgroupId=com.tutorialpoint.app -DartifactId=camel-first-app -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-spring -DinteractiveMode=false

它失败并显示以下错误:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
Downloading: 
http://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/1.8.3/groovy-1.8.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.981s
[INFO] Finished at: Tue Nov 14 23:11:42 IST 2017
[INFO] Final Memory: 10M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate failed: Plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.1 or one of its dependencies could not be resolved: Could not transfer artifact org.codehaus.groovy:groovy:jar:1.8.3 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/codehaus/groovy/groovy/1.8.3/groovy-1.8.3.jar from central failed: Connection reset -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

有人可以帮忙吗?

相关错误指向连接问题:

无法从/到中央( http://repo.maven.apache.org/maven2 )传输工件org.codehaus.groovy:groovy:jar:1.8.3:GET请求:org / codehaus / groovy / groovy / 1.8 .3 / groovy-1.8.3.jar from Central失败:连接重置

您发布的命令实际上在我的机器上运行正常。 如果执行此maven命令并且还没有Groovy库,您将看到它实际上下载了以下文件:

可能是您只能通过代理访问Internet。 在这种情况下,您将需要在Maven配置中设置代理。

这里的博客包含有关如何为Maven设置代理的相当不错的描述,以便Maven可以访问存储库。

解决您的问题的另一种方法是使用浏览器手动下载此文件:

然后使用以下命令将其手动安装到您的存储库中:

mvn install:install-file -Dfile=<path-to-file> -DgroupId=org.codehaus.groovy \
    -DartifactId=groovy -Dversion=1.8.3 -Dpackaging=jar

但通常您不必手动进行本手册的下载和安装。 Maven应该为您执行此操作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM