2017-08-04 114 views
1

我在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上工作。

回答

0

尋找一些原因,原型未在倉庫中發現或倉庫無法聯繫,然後它說:

Archetype not found in any catalog. Falling back to central repository. 

,如果你設置你的資料庫,您可以避免此行爲作爲鏡子

+0

所有這兩個警告也可以在Linux VM上成功構建的輸出中找到。設置我的回購「鏡子」,仍然是一樣的 – ddd

相關問題