报错信息
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\Administrator.m2\repository), alimaven (http://maven.aliyun.com/nexus/content/repositories/central/)]
加上阿里云的mirror
这个看到网上很多文章说是mirror的问题,但是改了settings.xml文件还是不可以
继续报错
Downloading from alimaven: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): transfer failed for http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml
最终解决办法
原因是ssl问题
实际上,
-
如果是在命令行中,还需要在mvn命令后面加上这个-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
-
如果是在idea中,需要这样配置