使用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>

  結果:

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM