使用Idea第一次创建一个Mavne工程时没有src目录

在使用idea创建一个maven工程时没有src目录,可能出现的问题很多,我先把我自己的问题分享上来

因为没有src,可能是因为maven插件还没下载到本地仓库、maven插件的版本和jdk版本冲突或者settings.xml中镜像配置的不对(一开始我的镜像没有配置就是最原始的)

我出现的问题:

镜像没有配置好,出现了各种不相关的问题:

  比如:

  1、[ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Failed to resolve version for org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Could not find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml in local (D:\javaSoftWare\apache-maven-3.5.3\maven-repository) -> [Help 1]

  2、[ERROR] Maven execution terminated abnormally (exit code 1)

  3、[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version

  用遍了网上各种的解决方案,都是行不通,甚至换了镜像(没有用阿里云的)都没起作用,最后想着说看别人用了阿里云的我也试试结果src也出现了控制台也不报错了

  如下:

  在settings.xml中:

<mirrors>
  <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>

  结果:

  

猜你喜欢

转载自www.cnblogs.com/rgever/p/9839310.html