问题描述:

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

网友答案:

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

网友答案:

Based on my personal experience,


It depends on the speed/bandwidth of your internet connection. You can try closing the other applications which are hogging the bandwidth.

If you are a windows user then:

To check what other applications are hogging your internet connectivity, execute the following command in command prompt:

"netstat -a -n -o"

It will give you the list of processes which are using you connection.

Try to terminate other non essential(other than system processes and maven process) processes through task manager. It will resolve the issue.

相关阅读:
Top