首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在创建新的java maven项目时出现错误“在当前项目和插件组中找不到前缀'archetype‘的插件”

在创建新的java maven项目时出现错误“在当前项目和插件组中找不到前缀'archetype‘的插件”
EN

Stack Overflow用户
提问于 2020-02-08 12:51:40
回答 3查看 8K关注 0票数 7

我正在尝试在Netbeans 8.2中创建一个新的java maven项目。我将按照以下步骤操作:

日志:

代码语言:javascript
复制
Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.0: Plugin org.apache.maven.plugins:maven-site-plugin:3.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.0
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.0
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
Failure to transfer org.apache.maven.plugins/maven-metadata.xml from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.914s
Finished at: Sat Feb 08 10:44:37 BDT 2020
Final Memory: 7M/119M

但是我得到了这个错误。

代码语言:javascript
复制
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 (/home/sultan/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
EN

回答 3

Stack Overflow用户

发布于 2020-04-07 10:49:25

我也遇到了同样的问题,在Netbeans 8.2上也是如此:

在Netbeans安装中,此设置更新适用于我:

转到Netbeans installation folder > java > maven > conf

对于我来说,它是C:\Program Files\NetBeans 8.2\java\maven\conf,在这里我使用管理权限更新了settings.xml文件。

由于http repo链接现在将不起作用,我只是为中心repo创建了一个有效的https镜像,该镜像是用IDE预先构建的,不能更改。

将这个添加到settings.xml的镜像标记中

代码语言:javascript
复制
<mirror>
      <id>mirror1</id>
      <mirrorOf>central</mirrorOf>
      <name>mirror1</name>
      <url>https://repo.maven.apache.org/maven2/</url>
</mirror>

重新启动Netbeans IDE后,中央存储库将被我们指定的https://repo.maven.apache.org/maven2/镜像覆盖。

票数 16
EN

Stack Overflow用户

发布于 2020-02-08 13:13:25

输出部分显示为ReasonPhrase:HTTPS Required,因此它无法向http端点发出适当的请求。

尝试在maven设置中更改maven中央存储库的URL。

全局变量在:${maven.home}/conf/settings.xml

和用户设置在:${user.home}/.m2/settings.xml

您可能正在使用Netbeans安装附带的maven,那么您需要在netbeans安装文件夹中搜索该设置文件。尝试转到netbeans界面上的Tools/Options/Maven -应该有关于当前使用的maven目录的位置的信息。

在这些文件中搜索repo.maven.apache.org/maven2 (或日志中的整个URL ),并将http更改为https

只是为了添加,错误包含http://repo.maven.apache.org/maven2 URL -也许您可以在该settings.xml文件中搜索它,并将http更改为https

有关更多信息,请查看以下两个问题:

Can not find where maven local repository path in netbeans 8.0.2 is set

Change Maven repository that NetBeans uses

有关其他信息,请参阅中的简短描述:

https://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

票数 1
EN

Stack Overflow用户

发布于 2020-10-12 02:35:02

我也有同样的问题。我的path和java_home设置为open jdk。切换到oracle jdk修复了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60124030

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档