title: Archetype:generate behavior for maven-archetype-quickstart
body: <p>I am trying to create understand why a certain combination of arguments to archetype:generate works where as others don't.  I am attempting this for <code>maven-archetype-quickstart</code>.</p>
  
  <p>Project creation works when I specify neither <code>archetypeVersion</code> nor <code>interactiveMode=false</code>.</p>
  
  <pre><code>mvn archetype:generate -DarchetypeGroupId="apache.maven.archetypes" -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1  -Dversion=1.0-SNAPSHOT
  </code></pre>
  
  <p>This runs in interactive mode of course.  It shows me several versions with the  latest one being 1.1.  This is also confirmed it from <a href="http://search.maven.org/#search%7Cga%7C1%7Cg:%22org.apache.maven.archetypes%22" rel="nofollow noreferrer">maven central</a>.  I then tried to get the project creation to work in non-interactive mode.  However, I found that if I specify either <code>interactiveMode=false</code> or <code>archetypeVersion=1.1</code> or both then the project creation fails; i.e. neither of the following work:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Finally I saw <a href="https://stackoverflow.com/questions/4909455/specify-archetype-for-archetypegenerate-on-command-line">this post</a> and noticed that archetypeGroupID wasn’t specified and decided to try it and it worked, i.e. the following works in non-interactive mode:</p>
  
  <pre><code>mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId="com.mycompany.mygroup" -DartifactId=artifact1  -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
  </code></pre>
  
  <p>I am quite confused as to why is that.  I’d appreciate any pointers to help me understand this behavior better.</p>
  
  <p>In each of the problem cases the error (more or less) is as follows:</p>
  
  <pre><code>$ 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] &gt;&gt;&gt; maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom &gt;&gt;&gt;
  [INFO] 
  [INFO] &lt;&lt;&lt; maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom &lt;&lt;&lt;
  [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=&lt;your repository&gt; 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) -&gt; [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
  </code></pre>