[java] Create a Maven project in Eclipse complains "Could not resolve archetype"

I am totally a newbie with Maven. I want to create a Maven project with Eclipse Juno EE with archetype "webapp". I installed "Maven Integration for Eclipse WTP (incubation)" and I also have installed "Maven Integration for Eclipse" (found it on Installed tab of Eclipse Marketplace). When I try to create new Project from File->New_>Maven Project, I obtain error:

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 (C:\Documents and Settings\PEP35KD\.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 (C:\Documents and Settings\PEP35KD\.m2\repository)

It happens for all kinds of archetype. I am using a proxy, and I create file settings.xml under C:\Documents and Settings\PEP35KD.m2\ with this content:

<proxies>
    <proxy>
        <id>myId</id>
        <active>true</active>
        <protocol>http</protocol>
        <username>rete\pep35kd</username>
        <password>XXXX</password>
        <host>XXXX</host>
        <port>8080</port>
        <nonProxyHosts>localhost</nonProxyHosts>
    </proxy>
</proxies>

Please, consider that it seems that I cannot use mvn command from command line (command not found). I never installed Maven itself, I thinked that plugin is just enough: is it a correct assumption?

UPDATE Problem is definitely related to proxy. By:

  • Installing Maven on local PC;
  • Installing Maven Eclipse from Eclipse Market Place;
  • Setting Maven Install directory to local PC Maven dir, instead of default Embedded Maven,

everything works as expected. I cannot really understand why, but probably firewall is blocking traffic with Maven servers.

This question is related to java eclipse maven

The answer is


click windows-> preferences->Maven. uncheck "Offline" check box. This was not able to download archetype which I was using. When I uncheck it, Everything worked smooth.


You will need to install the m2eclipse or any other maven plugin in your eclipse. Some eclipse come with maven and its plugins installed. Otherwise go to Help->software Install, select All sites, filter list with maven, and then install the plugin. Then look at this link. Hope it helps.


Add your MAVEN_HOME environment variable, edit your Path to include %MAVEN_HOME%/bin then try creating the project manually with Maven:

mvn archetype:generate -DgroupId=com.program -DartifactId=Program -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Then import the existing Maven project to Eclipse.


I was getting similar error while creating web-app in eclipse and resolved the problem just by cleaning (deleting all files from) and rebuilding the maven repository


You can resolve it by configuring settings.xml in Eclipse.

Go to Window --> Preferences --> Maven --> User Settings --> select the actual path of settings.xml


I find it solution http://www.scriptscoop.net/t/7c42f9d698a4/java-create-maven-project-could-not-resolve-archetype-connection-refused.html

We can see the origin of the problem : Connection refused: connect

I have already do this :

1) Window -> Preferences -> General -> Network Connections. I put in Manual with the url and port of my proxy for HTTP protocol. It works because before this, Spring Tool Suite did not want to update. After, it's okay.

2) Window -> Preferences -> Maven -> User Settings. In Global Settings, is empty. In User Settings, I put the path to settings.xml. In this file, i have :

enter image description here


i found the easiest way was to just remove/delete the .m2 folder and recreate it, putting back your settings.xml configuration details(if applicable).


This might sound silly, but make sure the "Offline" checkbox in Maven settings is unchecked. I was trying to create a project and got this error until I noticed the checkbox.


It is also possible that your settings.xml file defined in maven/conf folder defines a location that it cannot access


First things first, you have to install Maven on your workstation. You need also to install M2E, what you obviously did. Not all distributions of Juno have it pre-installed.

Then configure your Eclipse so it can find your Maven install. In the menu Window -> Preferences, then open the Maven section. In your right panel, you have a list of the Maven installations Eclipse knows. Add your installation and select it instead of the embedded Maven provided with M2E. Don't forget to set the "Global settings from installation directory" field with the path to the settings.xml of your Maven installation.

Which leads us to the settings.xml. If the above doesn't solve your problem, you will have to configure your Maven. More infos here.


Goto Preferences: -> Maven Click 'Add Remote Catalog' File: http://repo1.maven.org/maven2/archetype-catalog.xml Desc: Catalog


Adding the following inside "mirrors" section in the user setting.xml file worked for me.

<mirror>
  <id>ibiblio.org</id>
  <url>http://mirrors.ibiblio.org/maven2</url>
  <mirrorOf>central</mirrorOf>
</mirror>

Assuming that you have your proxy settings correct, you may have missed out pointing Eclipse to the intended settings.xml file. This happens often when you have both Maven installed as a snap in, and an external installation outside Eclipse. You need to tell Eclipse which Maven installation it should use, and which settings.xml file it should be looking for.

First check that the settings.xml file contains your proxy settings.

enter image description here

Next, check that the user settings.xml file here contains your proxy settings.

enter image description here

If you have made any changes, restart Eclipse.


Goto Preferences: -> Maven

1. check Download Artifact Source
2. check Download Artifact JavaDoc

Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to maven

Maven dependencies are failing with a 501 error Why am I getting Unknown error in line 1 of pom.xml? Why am I getting "Received fatal alert: protocol_version" or "peer not authenticated" from Maven Central? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Unable to compile simple Java 10 / Java 11 project with Maven ERROR Source option 1.5 is no longer supported. Use 1.6 or later 'react-scripts' is not recognized as an internal or external command How to create a Java / Maven project that works in Visual Studio Code? "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException