Could not resolve archetype org-apache-maven-archetypes-maven-webapp

今天创建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

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

 

width="336" height="280" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" id="aswift_1" name="aswift_1" style="border-width: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; max-width: 100%; left: 0px; position: absolute; top: 0px;">

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

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

Solution #2:

For any other issues delete maven local repository and run mvn:install again.

width="336" height="280" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" id="aswift_2" name="aswift_2" style="border-width: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: none; padding: 0px; vertical-align: baseline; max-width: 100%; top: 0px; left: 0px; position: absolute;">

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

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

 

width="336" height="280" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" id="aswift_1" name="aswift_1" style="border-width: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; max-width: 100%; left: 0px; position: absolute; top: 0px;">

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

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

could-not-resolve-archetype-org-apache-maven-archetypesmaven-archetype

Solution #2:

For any other issues delete maven local repository and run mvn:install again.

width="336" height="280" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" id="aswift_2" name="aswift_2" style="border-width: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: none; padding: 0px; vertical-align: baseline; max-width: 100%; top: 0px; left: 0px; position: absolute;">


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值