Failed to retrieve plugin descriptor for org.apache.maven.plugins错误解决方法

是用maven创建project时碰到下面的错误:

D:\codes\JSF>mvn archetype:create -DgroupId=com.tutorialspoint.test -DartifactId
=helloworld -DarchetypeArtifactId=maven-archetype-webapp
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom

[WARNING] 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: repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom

[WARNING] 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: repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml

[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect

[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml

[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect

[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.479s
[INFO] Finished at: Tue Oct 18 12:44:58 BST 2011
[INFO] Final Memory: 1M/15M
[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\krsl1254\.m2\repository), central (repo1.maven.org/maven2)] 

在maven的配置文件$maven\conf\settings.xml中增加代理信息即可:

<proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>

S D:\project_vscode\demo> ./mvnw spring-boot:run [INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/与%20Spring%20Boot%20版本一致/spring-boot-maven-plugin-与%20Spring%20Boot%20版本一致.pom [WARNING] Failed to retrieve plugin descriptor for org.springframework.boot:spring-boot-maven-plugin:与 Spring Boot 版本一致: Plugin org.springframework.boot:spring-boot-maven-plugin:与 Spring Boot 版本一致 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 (absent): Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 from/to central (https://repo.maven.apache.org/maven2): status code: 400, reason phrase: Invalid URI (400) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.519 s [INFO] Finished at: 2025-03-21T23:58:44+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:与 Spring Boot 版本一致 or one of its dependencies could not be resolved: [ERROR] The following artifacts could not be resolved: org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 (absent): org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 from/to central (https://repo.maven.apache.org/maven2): status code: 400, reason phrase: Invalid URI (400) [ERROR] -> [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
最新发布
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值