Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating project in Interactive mode Taking lot of time

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

like image 429
user2523808 Avatar asked Jul 08 '13 10:07

user2523808


People also ask

How do I create a Maven project in interactive mode?

2. Maven create Java project with maven interactive mode. In interactive mode, You just need to start with “ mvn archetype:generate ” and rest of the options will be specified using a wizard which will come one by one.

What is Archetype maven?

In short, Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made. The names fits as we are trying to provide a system that provides a consistent means of generating Maven projects.

What is Maven archetype plugin?

The Archetype Plugin allows the user to create a Maven project from an existing template called an archetype. It also allows the user to create an archetype from an existing project.


2 Answers

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

like image 150
rilaby Avatar answered Sep 18 '22 05:09

rilaby


For the users trying to build using their local archetypes, an alternate way would be to just append -DarchetypeCatalog=local after your command.

This should look like

mvn archetype:generate -DarchetypeCatalog=local

to tell maven just looking type catalog from local instead of remote.

like image 21
Flux Avatar answered Sep 19 '22 05:09

Flux