我在Windows 10集運行Maven 3.5 .m2目錄下兩個儲存/ settings.xml中Maven的不下載文物爲什麼從指定的存儲庫
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>maven-release</name>
<url>https://artifacts.repo.openearth.community/artifactory/distarch-maven-staging</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>maven-snapshots</name>
<url>https://artifacts.repo.openearth.community/artifactory/distarch-maven-snapshots</url>
</repository>
</repositories>
現在我需要創建一個自定義的快速啓動原型項目這是發佈在maven-release
回購。
mvn archetype:generate -DarchetypeGroupId=com.lgc.dist -DarchetypeArtifactId=com.lgc.dist.core.msp.quickstart -DarchetypeVersion=0.1 -DinteractiveMode=false -DgroupId=com.foo -DartifactId=com.foo.example.firstservice -Dversion=1.0-SNAPSHOT -DserviceName=FirstService -Dpackage=com.foo.example.firstservice
快速啓動神器com.lgc.dist.core.msp.quickstart
可在https://artifacts.repo.openearth.community/artifactory/distarch-maven-staging/com/lgc/dist/com.lgc.dist.core.base.pom/0.1/com.lgc.dist.core.base.pom-0.1.pom
。罐子也一樣。
然而mvn命令的輸出顯示它正試圖從沒有在settings.xml文件中定義的任何地方apache.org
Maven倉庫
[INFO] Generating project in Batch mode
[WARNING] Archetype not found in any catalog. Falling back to central repository.
[WARNING] Add a repsoitory with id 'archetype' in your settings.xml if archetype's repository is elsewhere.
Downloading: https://repo.maven.apache.org/maven2/com/lgc/dist/com.lgc.dist.core.msp.quickstart/0.1/com.lgc.dist.core.msp.quickstart-0.1.pom
[WARNING] The POM for com.lgc.dist:com.lgc.dist.core.msp.quickstart:jar:0.1 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/com/lgc/dist/com.lgc.dist.core.msp.quickstart/0.1/com.lgc.dist.core.msp.quickstart-0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.488 s
[INFO] Finished at: 2017-08-03T21:46:38-05:00
[INFO] Final Memory: 15M/170M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.lgc.dist:com.lgc.dist.core.msp.quickstart:0.1) -> [Help 1]
我跑mvn -X
檢查下載的設置文件,它正在使用和它顯示它是.m2/settings.xml。爲什麼它不起作用?有什麼特別的設置爲Windows 10?相同的命令在具有相同設置的Linux VM上工作。
相同的命令適用於具有Maven 3.3.9但不適用於Windows 10和Maven 3.5.0的Linux VM。 Settings.xml對於這兩種環境都是相同的 – ddd