解决命令行构建maven项目报错

[ERROR] 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\NayelyA\.m2\repository), central (https://repo.mav
en.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

该问题由于网络问题导致,已有的镜像仓库

https://maven.aliyun.com/repository/central

无法访问或者网速过慢

将setting.xml改成如下,即可

  
     
           alimaven
           aliyun maven
           http://maven.aliyun.com/nexus/content/groups/public/
           central        
     
     
           UK
           UK Central
           http://uk.maven.org/maven2
           central
     
      
           ibiblio.org 
           ibiblio Mirror of http://repo1.maven.org/maven2/ 
           http://mirrors.ibiblio.org/pub/mirrors/maven2 
           central 
           
     
     
         jboss-public-repository-group
         central
         JBoss Public Repository Group
         http://repository.jboss.org/nexus/content/groups/public  
     
  

只用一个mirror,也可以(我的maven项目只使用了第一个mirror)

http://maven.aliyun.com/nexus/content/groups/public/


参考链接:https://blog.csdn.net/weixin_40992982/article/details/104087472

你可能感兴趣的:(maven,java)