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:
everything works as expected. I cannot really understand why, but probably firewall is blocking traffic with Maven servers.
If you want a web application, use maven-archetype-webapp, or if you want a simple application use maven-archetype-quickstart. They are useful because you will be able to expand them with no problem. Note that this is in the Eclipse plugin by default (at least it is today).
So if you want to change your project nature you've to do it "by hand". It seems that in your case, you just have to change in pom. xml, the package type to war and to proceed a "Maven update project" in your IDE so maven plugin will update configuration. Perfect Answer!
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
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.
Next, check that the user settings.xml file here contains your proxy settings.
If you have made any changes, restart Eclipse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With