I'm trying to create a new Maven project but I can't. I tried the command line and also through Eclipse.
The error I get when trying to use the command line is along the lines of
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\MY_NAME.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
After searching around for the solution to the error, the problem seems to occur because I'm behind a firewall/proxy here at work.
I was then advised to go into Eclipse and try adding the remote catalog URL to Eclipse. What I done was I went to Windows > Preferences > Maven > Archetypes > Add Remote Catalog. I then put it http://repo1.maven.org/maven2/archetype-catalog.xml for the "Catalog File" field and maven catalog for the "Description" field.
I then click Verify to see if it was working and I got a warning saying that the "Remote catalog is empty".
I went ahead and tried to create a new Maven project anyway. After filling out my groupId and all that, I click finish. Another error comes up saying
Could not resolve archetype
org.apache.maven.archetypes:maven-archetype-webapp:1.0 form any of the configured repositories.
How do I get around this?
I fixed it today by firstly downloading the file in the browser then adding it as local file
http://repo1.maven.org/maven2/archetype-catalog.xml is the "given" link to get access the the remote archetype.
However it may be outdated. You need to include http (s) therefore https://repo1.maven.org/maven2/archetype-catalog.xml is what is required to get the remote archetypes to appear in eclipse or your favorite browser.
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