Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven: Failed to retrieve plugin descriptor error

Tags:

maven

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?

like image 843
Basith Avatar asked Oct 19 '11 09:10

Basith


6 Answers

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

like image 69
Snake Sanders Avatar answered Nov 12 '22 23:11

Snake Sanders


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>
like image 43
Rakesh Prabhakaran Avatar answered Nov 13 '22 00:11

Rakesh Prabhakaran


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.

like image 6
fiberair Avatar answered Nov 12 '22 23:11

fiberair


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.

like image 3
mar915h Avatar answered Nov 13 '22 00:11

mar915h


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
like image 3
Ami Bhushan Jha Avatar answered Nov 12 '22 22:11

Ami Bhushan Jha


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>

like image 1
tester Avatar answered Nov 12 '22 23:11

tester