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

I installed maven3.0.3 on my local computer. Installed the 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 the proxy server, and the proxy server settings are updated in {HOME}/.m2/settings.xml and M2_HOME/conf/settings.xml.

The archetype generation command works great on the command line. He downloaded dependencies through a proxy.

Any help is greatly appreciated.

Edit 05-10-2012 When creating a new Maven web project in eclipse, the version of the archetype "maven-archetype-webapp" is displayed as RELEASE. Is this related?

+24
eclipse maven m2eclipse
Oct 05
source share
19 answers

I had the same problem. I fixed this by adding the maven archetype directory to eclipse. The steps are below:

+45
Apr 03 '13 at 13:52
source share

I found the following tutorial very useful.

Step 1: the maven command used to create the web application: mvn archetype: generate -DgroupId = test.aasweb -DartifactId = TestWebApp-DarchetypeArtifactId = maven-archetype-webapp

Step 2. The following entry was added to the pom.xml project.

 <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> 

Step 3. Run the maven command to convert to the eclipse project format. mvn eclipse: net eclipse: eclipse

Step4: Import the project into eclipse as an existing Maven project.

+4
Oct 16
source share

Read the reason carefully.

"Failed to solve 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 have to do is upload maven-metadata.xml to your {HOME} .m2 \ repository

What is it.

+3
May 22 '14 at 14:23
source share

You need to have settings.xml parameter associated with user settings (located in settings under maven)

But if this is not corrected, as it was not for many of you. You must also delete the directory:

.m2 / vault / org / Apache / Maven / archetypes / Maven-archetype-Quickstart

then close the eclipse and try again.

Here is what solved my problem.

+3
Sep 13 '16 at 18:41
source share

If you use eclipse, you can follow these steps ( maven in 5 minutes without work ) to get your proxy information. After that, do the following:

  • Go to the Maven installation folder C:\apache-maven-3.1.0\conf\
  • Copy settings.xml to C:\Users\[UserFolder]\.m2
  • Change the proxy server in settings.xml based on the information obtained from the link above.

     <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 folder from .m2

  • Click Update Settings

  • Click Reindex

  • Apply the changes and click OK

Now you can try creating the Maven Project in Eclipse.

+2
Aug 12 '13 at 11:37
source share

Go to Windows-> Preference-> Maven -> User Preferences

Select settings.xml from Maven

Restart Eclipse

+1
Mar 28 '17 at 12:57
source share

I had a similar problem from the Maven command line. In the end, I walked past this error by adding -U to the maven arguments.

Depending on how you configured your source repository in your settings.xml file, sometimes Maven cannot load a particular artifact, so it assumes that the artifact cannot be loaded, even if you change some settings that Maven will give for the artifact if he just tried. -U makes Maven look again.

Now you need to make sure that the Maven artifact is looking in at least one of the repositories that your settings.xml is referencing. To know for sure, run

 mvn help:effective-settings 

from the directory of the module you are trying to build. This should give you, among other things, a complete list of repositories that you use Maven to search for the artifact.

0
Aug 29 '16 at 21:55
source share

I also had the same problem, but after searching it solved. go to menu โ†’ window โ†’ settings โ†’ maven โ†’ Preferences โ†’ add โ†’ instead of installing home add the path to the directory in which you installed maven โ†’ finish โ†’ check the field of newly added content โ†’ apply โ†’ ok. now create a new maven project, but remember, try with id group id and artifact.

0
Sep 22 '16 at 10:20
source share

I had the same problem, I solved it by adding only the remote directory in eclipse go to Window โ†’ Settings โ†’ Maven โ†’ Archetypes โ†’ click to add the remote directory, then a window with this paste will open
http://repo.maven.apache.org/maven2/archetype-catalog.xml in this directory file, then click ok, restart eclipse, now everything works fine

0
Oct 30 '17 at 9:55
source share

The correct way to solve my problem. Hope to be helpful to others. error information.

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories. Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0

  • Delete maven-archetype-webapp: 1.0 in the ~ / .m2 / repository / org / Apache / maven / archetypes directory

  • Download maven-archetype-webapp: 1.0 and maven-archetype-webapp-1.0.pom from http://maven.ibiblio.org/maven2/org/apache/maven/archetypes/maven-archetype-webapp/1.0/

  • run mvn install: install-file -DgroupId = org.apache.maven.archetypes -DartifactId = maven-archetype-quickstart -Dversion = 1.1 -Dpackaging = jar -Dfile = ๆญคๅค„ ๅกซ maven-archetype-webapp -1.0 ็š„ ่ทฏๅพ„.

  • try installing the webapp maven project to see if the problem is resolved.

0
Nov 20 '17 at 15:15
source share

Create new user environment variables:

 MAVEN_HOME=D:\apache-maven-3.5.3 MAVEN=D:\apache-maven-3.5.3\bin MAVEN_OPTS=-Xms256m -Xmx512m 

Added below to the Path variable (system variable):

 ;D:\apache-maven-3.5.3\bin; 
0
Apr 23 '18 at 17:17
source share

This worked for me: - go to windows-> preferences-> maven and check the "artifact download sources" and click "Apply."

0
Jul 25 '18 at 13:45
source share

No need to do all the above long steps.

Just delete the c: \ Users \ .m2 \ Repository \ org folder

Maven will automatically download what it needs

0
Aug 28 '18 at 7:13
source share

I just use the following steps:

Create a Maven project โ†’ check the checkbox โ†’ "Create a simple project (skip archetype selection)"

It works for me

0
Sep 04 '18 at 13:11
source share

I downloaded the flask and pom from: here and put them here:

 \.m2\repository\org\apache\maven\archetypes\maven-archetype-quickstart\1.1\ 
0
09 Oct '18 at 14:00
source share

I also got the same error .... And I found that my internet connection is closed, so eclipse cannot download repositories for webapps archetypes, and when I got an internet connection, I just re-created the maven project with webapps archetypes and my repositories loaded with eclipse made ...

0
Jan 11 '19 at 10:23
source share

This 100% works:

  • Delete the .m2 folder that is present on the desktop> User
  • connect your computer to the internet
  • Build Your Maven Project Again

So, I hope this helps

0
Jan 17 '19 at 8:22
source share

This can happen when eclipse cannot detect the corresponding jar files due to firewalls blocking url . Check out ~/.m2/repositories/org/apache/maven/archetypes . Check the jar file in the archetype folder you want. If it is not found, download it. Then you can create maven projects in eclipse

-one
Jan 19 '18 at 8:53
source share

The problem may also occur because you did not set the MAVEN_HOME environment MAVEN_HOME . Thus, Maven, built into Eclipse, cannot do its job to load the archetype. Check if this variable is set.

-2
Jun 13 '14 at
source share



All Articles