Posted By: Anonymous
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 SettingsPEP35KD.m2repository) 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 SettingsPEP35KD.m2repository)
It happens for all kinds of archetype.
I am using a proxy, and I create file settings.xml under C:Documents and SettingsPEP35KD.m2 with this content:
<proxies> <proxy> <id>myId</id> <active>true</active> <protocol>http</protocol> <username>retepep35kd</username> <password>✘✘✘X</password> <host>✘✘✘X</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
- 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.
I fixed this problem by following the solution to this other StackOverflow question
I had the same problem. I fixed it by adding the maven archetype catalog to eclipse. Steps are provided below: (Please note the https protocol)
- Open Window > Preferences
- Open Maven > Archetypes
- Click ‘Add Remote Catalog’ and add the following:
- Catalog File: https://repo1.maven.org/maven2/archetype-catalog.xml
- Description: maven catalog