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
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.
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With