Generating project in Interactive mode Taking lot of time

user2523808 picture user2523808 · Jul 8, 2013 · Viewed 9.5k times · Source
I run the Maven the command *mvn archetype:generate* in command Prompt
It shows
 [INFO] Scanning for projects...
 [INFO] ------------------------------------------------------------------------
 [INFO] Building Maven Stub Project (No POM) 1
 [INFO] ------------------------------------------------------------------------
 [INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
 [INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
 [INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
 [INFO] Generating project in Interactive mode

I am using Maven 3.0.5 version It is taking lot of time about 30 minutes to generate sample projects from the repository..

I dont know why it takes such a long time

Answer

rilaby picture rilaby · Oct 13, 2013

After typing mvn archetype:generate maven scans remote repositories for all available archetypes so in case you connection is low it can take a long time.

I've made an experiment. I've occupied the internet channel (by downloading a torrent file) and run the command - and it seemed as it is hanging. But as soon as I paused the download maven listed out 858 available archetypes.

If you know for sure the spelling of the archetypeArtifactId you can use parameter -DinteractiveMode=false (official page).

Example:
mvn archetype:generate
-DgroupId=my.groupid
-DartifactId=my-artifactId
-DarchetypeArtifactId=archetype-artifactId
-DinteractiveMode=false