Failed to resolve version for org.apache.maven.archetypes
Solution 1
I had the same problem. I fixed it by adding the maven archetype catalog to eclipse. Steps are provided below:
- Open Window > Preferences
- Open Maven > Archetypes
- Click 'Add Remote Catalog' and add the following:
- Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
- Description: maven catalog
Solution 2
I found the following tutorial very useful.
Step1: The maven command used to create the web app: mvn archetype:generate -DgroupId=test.aasweb -DartifactId=TestWebApp -DarchetypeArtifactId=maven-archetype-webapp
Step2: The following entry was added onto the project's pom.xml.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>1.5</wtpversion>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<classpathContainers>
<classpathContainer>
org.eclipse.jst.j2ee.internal.web.container
</classpathContainer>
<classpathContainer>
org.eclipse.jst.j2ee.internal.module.container
</classpathContainer>
/classpathContainers>
<additionalProjectFacets>
<jst.web>2.5</jst.web>
<jst.jsf>1.2</jst.jsf>
</additionalProjectFacets>
</configuration>
</plugin>
Step3: Run the maven command to convert into eclipse project format. mvn eclipse:clean eclipse:eclipse
Step4: Import the project onto eclipse as Existing Maven project.
Solution 3
You do need to have a settings.xml linked under user settings (Located in preferences under maven)
But, if that doesn't fix it, like it didn't for many of you. You also have to delete the directory:
.m2/repository/org/apache/maven/archetypes/maven-archetype-quickstart
then quit eclipse and try again.
This is what solved my problem.
Solution 4
Read carefully about the reason.
"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"
So all you need to do is download the maven-metadata.xml to your {HOME}.m2\repository
That's it.
Solution 5
If you are using eclipse, you can follow the steps here (maven in 5 min not working) for getting your proxy information. Once done follow the steps below:
- Go to Maven installation folder
C:\apache-maven-3.1.0\conf\
- Copy
settings.xml
toC:\Users\[UserFolder]\.m2
-
Modify the proxy in
settings.xml
based on the info that you get from the above link.<proxy> <active>true</active> <protocol>http</protocol> <host>your proxy</host> <port>your port</port> </proxy>
Open eclipse
Go to: Windows > Preferences > Maven > User Settings
Browse the
settings.xml
from.m2
folderClick
Update Settings
Click
Reindex
Apply the changes and Click
OK
You can now try to create Maven Project in Eclipse
Related videos on Youtube
Haroon
Updated on August 09, 2020Comments
-
Haroon almost 4 years
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?
-
khmarbaise almost 12 yearsorg.apache.maven.archetypes:maven-archetype-webapp:RELEASE this look strange ? Are you sure having the correct version? (search.maven.org/…)
-
Haroon almost 12 years
-
Haroon almost 12 yearsThe eclipse message does say Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local ({HOME}/.m2/repository . Can there be any reason that eclipse isnt downloading maven-metadata.xml. The proxy works because I have installed the m2e plugin online. Any hints or directions?
-
khmarbaise almost 12 yearsYou should try it on command line first.
-
Haroon almost 12 years@khmarbaise The command executed succeffully on the commandline mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp and a web project was created. Im still unable to do it from Eclipse.
-
narendra-choudhary over 6 yearsI had a syntax error in settings.xml. Fixing the error solved the issue.
-
-
freesoft almost 10 yearsYour solution didn't work for me. Finally I solved the problem: See detailed steps at my response at stackoverflow.com/questions/25760961/…
-
user881703 over 7 yearsError while adding the catalog file: An internal error occurred during Downloading reomte catalog
-
viveksinghggits almost 7 yearswhile adding remote catalog when I click on verify it says
Remote catalog is empty
, if I continue anyway its not working -
kunal over 6 yearsThis worked for me, but then I started getting OOM exception in eclipse, because it starts pulling out the list of all the archtypes from the remote server, which takes some memory. I had to increase -Xmx in eclipse.ini, so we need to make sure that eclipse already has enough memory allocated.
-
Sandoval0992 almost 6 yearsMy problem was also solved just by pointing to the right settings.xml file. (Window/Preferences/Maven/User Settings)
-
vinsinraw over 4 yearsThough this works, but sometimes some other issue could make this solution ineffective. I had the issue with mirrors in my maven settings.xml. Once I commented out those in settings.xml, it worked for me.