archetype : generate에 대한 인수의 특정 조합이 다른 곳에서는 작동하지 않는 이유를 이해하려고합니다. maven-archetype-quickstart
에 대해이 작업을 시도하고 있습니다.Archetype : maven-archetype-quickstart에 대한 동작 생성
archetypeVersion
또는 interactiveMode=false
을 지정하지 않으면 프로젝트 생성이 작동합니다.
mvn archetype:generate -DarchetypeGroupId="apache.maven.archetypes" -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1 -Dversion=1.0-SNAPSHOT
이것은 대화식 모드에서 실행됩니다. 최신 버전이 1.1 인 여러 버전을 보여줍니다. 또한 maven central에서 확인되었습니다. 그런 다음 프로젝트 생성을 비대화 형 모드로 작동 시키려고했습니다. 그러나 interactiveMode=false
또는 archetypeVersion=1.1
또는 둘 다를 지정하면 프로젝트 생성이 실패합니다. 즉, 다음과 같은 작업도 :
mvn archetype:generate -DarchetypeGroupId="apache.maven.archetypes" -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1 -Dversion=1.0-SNAPSHOT -DarchetypeVersion=1.1
mvn archetype:generate -DarchetypeGroupId="apache.maven.archetypes" -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1 -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
mvn archetype:generate -DarchetypeGroupId="apache.maven.archetypes" -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1 -Dversion=1.0-SNAPSHOT -DarchetypeVersion=1.1 -DinteractiveMode=false
마지막으로 내가
this post을보고 archetypeGroupID 지정하고 그것을 시도하기로 결정되지 않았 음을 발견하고 비 대화식 모드에서 다음 작품 즉, 일 :
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1 -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
나는 왜 그렇게 혼란 스럽습니까? 나는이 행동을 더 잘 이해할 수 있도록 도와 줄 수있는 조언을 주시면 감사하겠습니다. 더 이상 더 사용 당신이 -Darchetype를 사용하는 버전에 따라
$ mvn archetype:generate -DarchetypeGroupId="apache.maven.archetypes" -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1 -Dversion=1.0-SNAPSHOT -DarchetypeVersion=1.1 -DinteractiveMode=false
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo1.maven.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: http://repo1.maven.org/maven2/apache/maven/archetypes/maven-archetype-quickstart/1.1/maven-archetype-quickstart-1.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.633s
[INFO] Finished at: Sat Mar 29 22:01:24 PDT 2014
[INFO] Final Memory: 13M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (apache.maven.archetypes:maven-archetype-quickstart:1.1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
예, 대화 형 모드가 잘 작동합니다. 왜 특정 조합의 플래그가 비 대화식 모드에서 작동하지 않는지 이해하고 싶었습니다. –