Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve version for org.apache.maven.archetypes

Tags:

I have configured maven3.0.3 in my local machine. Have installed m2e eclipse plugin. But when i try to create a new maven project using maven-archetype-webapp, i get the following exception.

 Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE    from any of the configured repositories.  Could not resolve artifact org.apache.maven.archetypes:maven-archetype- webapp:pom:RELEASE  Failed to resolve version for org.apache.maven.archetypes:maven-archetype- webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype- webapp/maven-metadata.xml in local ([HOME]/.m2/repository)  Failed to resolve version for org.apache.maven.archetypes:maven-archetype-  webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-  webapp/maven-metadata.xml in local ([HOME]/.m2/repository) 

I do some processing behind a proxy and the proxy configurations are updated in {HOME}/.m2/settings.xml and M2_HOME/conf/settings.xml.

The archetype generate command works fine in command line. It downloaded the dependencies through proxy.

Any help is greatly appreciated.

Edit 05-10-2012 While creating a new Maven Web project in eclipse, the archetype "maven-archetype-webapp" version is displayed as RELEASE. Is this in anyway linked?

like image 348
Haroon Avatar asked Oct 05 '12 08:10

Haroon


People also ask

Could not resolve archetype error while creating maven project in eclipse?

m2 folder located in your user home directory and delete the 1.1 folder located here : . m2\repository\org\apache\maven\archetypes\maven-archetype-quickstart . Restart Eclipse and try creating the project. This should download it again.

What is archetype in Maven project?

In short, Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made. The names fits as we are trying to provide a system that provides a consistent means of generating Maven projects.

Which Maven archetype should I use?

If you want a web application, use maven-archetype-webapp, or if you want a simple application use maven-archetype-quickstart. They are useful because you will be able to expand them with no problem. Note that this is in the Eclipse plugin by default (at least it is today).


1 Answers

I had the same problem. I fixed it by adding the maven archetype catalog to eclipse. Steps are provided below:

  1. Open Window > Preferences
  2. Open Maven > Archetypes
  3. Click 'Add Remote Catalog' and add the following:
    • Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
    • Description: maven catalog
like image 126
Justin Wrobel Avatar answered Oct 10 '22 22:10

Justin Wrobel