今天创建maven项目是遇到了这个问题,多亏了百度,让我苦苦找了n久时间没有找到答案,于是果断翻墙找到了办法,我就贴过来一起分享吧
could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype
OR
Create Maven project Eclipse complains
OR
Create a Maven project in Eclipse complains “Could not resolve archetype”
OR if you get below exception:
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories. Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\username\.m2\repository) Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\username\.m2\repository)
If you get above error when try to create maven project in eclipse. It’s proxy issue and due to proxy it blocks archetype. Please follow below steps:
- Go to your Maven installation folder C:\apache-maven-3.1.0\conf\ ( For example: here we have installed maven in c:\ drive)
- Copy settings.xml to C:\Users\[UserFolder]\.m2 (Your local repository)
- Modify the proxy in settings.xml based on the info that you get from the above link.
<proxy> <active>true</active> <protocol>http</protocol> <host>your proxy</host> <port>your port</port> </proxy>
Note: If you are not sure how to find proxy sever name which your local system is using: Please use this post
- Open eclipse
- Go to: Windows > Preferences > Maven > User Settings
- Browse the settings.xml from .m2 folder
- Click Update Settings
- Click Reindex
- Apply the changes and Click OK
Issue should be resolved after setting above.
If above solution not worked then try below:
- Go to your local .m2 folder that should be C:\Users\[UserFolder]\.m2 or search based on your user
- Delete folder name repository manually
- Now open eclipse again
- Go to: Windows > Preferences > Maven > User Settings
- Click Update Settings
- Click Reindex
- Apply the changes and Click OK
- This will create repository again refresh your eclipse and try again
- This should resolve the issue.
Below are some other solution if still not works try below:
Solution #1:
Please see if your network is using proxy then change proxy in settings.xml file:
Find proxy name in Internet explorer:
- To find proxy host name go to IE -> tools -> connection -> LAN settings -> advanced-> HTTP
Solution #2:
For any other issues delete maven local repository and run mvn:install again.
RELATED POST - YOU MAY ALSO LIKE
could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype
OR
Create Maven project Eclipse complains
OR
Create a Maven project in Eclipse complains “Could not resolve archetype”
OR if you get below exception:
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories. Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\username\.m2\repository) Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\username\.m2\repository)
If you get above error when try to create maven project in eclipse. It’s proxy issue and due to proxy it blocks archetype. Please follow below steps:
- Go to your Maven installation folder C:\apache-maven-3.1.0\conf\ ( For example: here we have installed maven in c:\ drive)
- Copy settings.xml to C:\Users\[UserFolder]\.m2 (Your local repository)
- Modify the proxy in settings.xml based on the info that you get from the above link.
<proxy> <active>true</active> <protocol>http</protocol> <host>your proxy</host> <port>your port</port> </proxy>
Note: If you are not sure how to find proxy sever name which your local system is using: Please use this post
- Open eclipse
- Go to: Windows > Preferences > Maven > User Settings
- Browse the settings.xml from .m2 folder
- Click Update Settings
- Click Reindex
- Apply the changes and Click OK
Issue should be resolved after setting above.
If above solution not worked then try below:
- Go to your local .m2 folder that should be C:\Users\[UserFolder]\.m2 or search based on your user
- Delete folder name repository manually
- Now open eclipse again
- Go to: Windows > Preferences > Maven > User Settings
- Click Update Settings
- Click Reindex
- Apply the changes and Click OK
- This will create repository again refresh your eclipse and try again
- This should resolve the issue.
Below are some other solution if still not works try below:
Solution #1:
Please see if your network is using proxy then change proxy in settings.xml file:
Find proxy name in Internet explorer:
- To find proxy host name go to IE -> tools -> connection -> LAN settings -> advanced-> HTTP
Solution #2:
For any other issues delete maven local repository and run mvn:install again.