gpt4 book ai didi

java - 使用maven在java中创建新项目

转载 作者:行者123 更新时间:2023-12-01 12:24:53 25 4
gpt4 key购买 nike

我想用maven创建一个java项目,当我在cmd中输入这个命令而不是创建一个项目时,它给出了一些错误,我猜这是因为一些互联网问题,但我不知道如何解决它。我不使用任何代理,即使我的电脑防火墙已关闭,我也尝试过此命令。我在cmd中编写的命令是:

mvn archetype:generate -DgroupId=com.companyname.bank -DartifactId=consumerBanking -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

结果是:

[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.167 s
[INFO] Finished at: 2012-05-18T21:09:38-07:00
[INFO] Final Memory: 3M/254M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\a\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]

最佳答案

您在 2014 年发布此内容,但日志显示:

[INFO] Finished at: 2012-05-18T21:09:38-07:00

如果您的本地时钟错误,SSL 将无法工作,因为证书将显示为无效,并且您与 https://repo.maven.apache.org/ 的连接将无法正常工作。将会失败。

修复你的时钟。

关于java - 使用maven在java中创建新项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26442108/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com