[maven] Maven: Failed to retrieve plugin descriptor error

I configured Maven 3.0.3 and tried to download a sample project using archetypes with this command:

mvn archetype:generate -DarchetypeGroupId=org.graniteds.archetypes 
                       -DarchetypeArtifactId=graniteds-tide-spring-jpa-hibernate 
                       -DgroupId=org.example 
                       -DartifactId=gdsspringflex 
                       -Dversion=1.0-SNAPSHOT

(Command from this link : http://java.dzone.com/articles/enterprise-ria-spring-3-flex-4 )

And I got this error:

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)] -> [Help 1]

I tried searching some posts similar to this but couldn't get an answer. I tried changing proxy settings in settings.xml but it still doesn't work. Could you please help me out?

This question is related to maven

The answer is


In my case, even my system is not behind proxy, I got same issue. I was able to resolve by typing mvn help:archetype before mvn archetype:generate


This problem will solve when we change the version of apache-maven

I faced it and it was solved when i used apache-maven-2.2.1


I had the same problem because I was using port 80 instead of 8080 in the settings.xml proxy configuration


I had the same error. In my case I am using Netbeans 7.1.2, I am posting this because maybe someone end up here same as I did.

I tried to configure the proxy options from the GUI, but the documentation says that maven doesn't read those. So I checked the NetBeans FAQ here :

What mainly you have to do is create (if it does not exist) a settings.xml under

user.home/.m2/settings.xml

if you don't have it you can copy from

netbeans.home/java/maven/conf/settings.xml

then uncomment if you already have it otherwise just fill this section:

<proxies>
 <proxy>
   <active>true</active>
   <host>myproxy.host.net</host>
   <port>80</port>
 </proxy>
</proxies>

you have to check your proxy configuration and replace it there


I had to change my password to the latest in the user.home/.m2/settings.xml file!


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>

If you created new settings.xml file instead of copy it from somewhere else, remember to put the tag inside :

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> <proxies> ..... </proxies> </settings>


For me, the solution given on the page maven is not able to download anything from central because ssl don't work worked, when running Mint 19 in a VM:

sudo apt install ca-certificates-java
sudo update-ca-certificates -f

I wouldn't advise you to do this but on my personal computer I disabled the firewall so that maven could get the required plugins.


I was having exactly the same problem.I went to my IE setting->LAN Settings.Then copied the Address as host and port as the port and it worked. Following is the snapshot of the proxies tag in the Settings.xml that I changed.

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


Thank it worked...

edit setting.xml

and replace proxy with this

Its working 100%

<proxy>      
  <active>true</active>
  <protocol>http</protocol>
  <username>your username</username>
  <password>password</password>    
  <host>proxy.host.net</host>
  <port>80</port>  


I had the same issue in Windows

and it worked since my proxy configuration in settings.xml file was changed

So locate and edit the file inside the \conf folder, for example : C:\Program Files\apache-maven-3.2.5\conf

<proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>jorgesys</username>
      <password>supercalifragilisticoespialidoso</password>
      <host>proxyjorgesys</host>
      <port>8080</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>
  • In my case i had to chage from port 80 to 8080
  • If you canĀ“t edit this file that is located inside /program files you can make a copy, edit the file and replace the file located into /program files folder.

Mac OSX 10.7.5: I tried setting my proxy in the settings.xml file (as mentioned by posters above) in the /conf directory and also in the ~/.m2 directory, but still I got this error. I downloaded the latest version of Maven (3.1.1), and set my PATH variable to reflect the latest install, and it worked for me right off the shelf without any error.


In my case, it was not worknig even after passing the proxy credentails.

Mistake was - forgot to remove the comment line.

<!-- proxy
 | Specification for one proxy, to be used in connecting to the network.

<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>345325</username>
  <password>dfgasdfg</password>
  <host>proxy.abc.com</host>
  <port>8080</port>
  <nonProxyHosts>proxy.abc.com</nonProxyHosts>
</proxy>
|-->    ----------REMOVE THIS LINE AND CLOSE It above <proxy> tag

I have to put

 <proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <host>Your proxy host</host>
  <port>proxy host ip</port>
  <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>

Before

 <proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>https</protocol>
  <host>Your proxy host</host>
  <port>proxy host ip</port>
  <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>

Weird, but yes!, <protocol>http</protocol> has to come before <protocol>https</protocol>. It solved my problem. Hope it helps someone who faces connections issue even after enabling proxy settings in conf/settings.xml.