Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quick
很久用eclipse了,创建maven的quickstart项目时出现错误“Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quick……”
emmm,网上看到的方法是下载一个maven-archetype-quickstart-1.1.jar文件,之后执行安装,刚好我本地有一个这样的文件,就将其复制到maven安装目录下的lib目录中,并执行如下的命令
mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=maven-archetype-quickstart-1.1.jar
忽然想为啥会出现这个问题?明明之前使用eclipse的时候都没什么事。
看到执行上述mvn时出现的INFO如下
[INFO] Scanning for projects... [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom --- [INFO] Installing D:\apache-maven\apache-maven-3.6.0\lib\maven-archetype-quickstart-1.1.jar to E:\IntelliJ\maven-repository\org\apache\maven\archetypes\maven-archetype-quickstart\1.1\maven-archetype-quickstart-1.1.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.945 s [INFO] Finished at: 2019-11-03T11:04:44+08:00 [INFO] ------------------------------------------------------------------------
难道是因为自己使用IDEA后重新配置了maven的本地仓库的原因?
记录一下。
附上参考博客:https://www.cnblogs.com/xsi640/p/3758095.html