2013-11-01 47 views
0

我使用Maven創建與後續的命令般地項目:如何使用Maven創建一個Camel項目?

mvn archetype:create -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-java -DarchetypeVersion=2.12.1 -DgroupId=camelinaction -DartifactId=order-router

然後使用命令後,我得到ERRORS並沒有什麼作品。

我在做什麼錯?

回答

3

嘗試archetype:generate而不是archetype:create

mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-java -DarchetypeVersion=2.12.1 -DgroupId=camelinaction -DartifactId=order-router

在此之後,如果你讀了你在其他職位曾與log4j的問題的解決方案,你應該罰款。

+0

謝謝你完全解決了我的問題!雖然我不明白...爲什麼這個命令有效,另一個不是?無論如何,這是另一個問題的材料:P 謝謝! –

1

問題是該原型不在Maven中心目錄中。你必須指定應該從哪裏獲取原型,如:

mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-java -DarchetypeVersion=2.3-SNAPSHOT -DgroupId=cameinaction -DartifactId=order-router -DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group 
+0

這很奇怪,特別要記住,在「駱駝在行動」一書中提出了命令。謝謝 ! –

+0

它是否解決了您的問題? –

+0

該命令實際上不起作用。但是Grove給出的命令是。我仍然給你+1,因爲你嘗試過。 –

相關問題