Maven: Failed to retrieve plugin descriptor error

来源:互联网 发布:软件开发助理工程师 编辑:程序博客网 时间:2024/06/05 07:52
问题描述:
在记性Maven打包操作mvn clean package时,提示错误如下:
[ERROR] Plugin org.apache.maven.plugins:maven-jar-plugin:2.4 or one of its dependencies could not be resolved: Failed to read arti
org.apache.maven.plugins:maven-jar-plugin:jar:2.4: Could not transfer artifact org.apache.maven.plugins:maven-jar-plugin:pom:2.4 f
://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:80 [repo.maven.apache.org/23.235.47.215] failed: Connection tim
Help 1]

解决方案:

I had a similar issue with Eclipse and the same steps as Sanders did solve it. It happens because the proxy restricts call to maven repository

  1. Go to D:\Maven\apache-maven-3.0.4-bin\apache-maven-3.0.4\conf (ie your maven installation folder)
  2. Copy settings.xml and paste it in .m2 folder, which is in the users folder of your windows machine.
  3. Add the proxy setting

Something like this:

 <proxies>    <!-- proxy      Specification for one proxy, to be used in connecting to the network.     -->    <proxy>            <active>true</active>      <protocol>http</protocol>      <username>your username</username>      <password>password</password>          <host>proxy.host.net</host>      <port>80</port>      </proxy>  </proxies>
文章转自:Maven: Failed to retrieve plugin descriptor error
0 0