myeclipse10创建maven项目失败
创建maven项目时选择 artifact id 为maven-archetype-webapp 点击完成报错如下,百度后解决不了
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 (D:\mavenrepository)
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 (D:\mavenrepository)
不知道是何缘故,maven版本apache-maven-2.2.1,猜想可能是C:\Users\Administrator\.m2 下setting.xml或者是D:\Program Files\apache-maven-2.2.1\conf下setting.xml配置有问题,请有经验的朋友指点一下
------解决方案--------------------
很明显您pom里相关版本的maven-archetype-webapp在服务器的repository里没有这个jar文件
解决办法是自己网上下载这个jar,然后到.m2的相关文件夹去用mvn install去安装这个jar文件就好。
mvn install:install-file -Dfile=your-artifact-1.0.jar \
[-DpomFile=your-pom.xml] \
[-Dsources=src.jar] \
[-Djavadoc=apidocs.jar] \
[-DgroupId=org.some.group] \
[-DartifactId=your-artifact] \
[-Dversion=1.0] \
[-Dpackaging=jar] \
[-Dclassifier=sources] \
[-DgeneratePom=true] \
[-DcreateChecksum=true]