原帖地址:http://tieba.baidu.com/p/2804486258
剛開始學習用Maven, 裝好了以後生成一個新的project
mvnarchetype:generate -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple-Dpackage=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
然後cmd輸出卡死在Generating project in Interactive mode不動了,-X 打開debug模式重試了一次:
mvnarchetype:generate -X -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple -Dpackage=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT
原來是卡在這裏了:
[DEBUG] -- end configuration --
[INFO] Generating project in Interactive mode
[DEBUG] Searching for remote catalog: http://repo1.maven.org/maven2/archetype-catalog.xml
加個參數 -DarchetypeCatalog=internal 讓它不要從遠程服務器上取catalog:
mvn archetype:generate -DarchetypeCatalog=internal -DgroupId=org.sonatype.mavenbook.simple -DartifactId=simple -Dpackage=org.sonatype.mavenbook -Dversion=1.0-SNAPSHOT