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

Haroon picture Haroon · Oct 5, 2012 · Viewed 123.9k times · Source

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?

Answer

Justin Wrobel picture Justin Wrobel · Apr 3, 2013

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: