Take a long time to create a project using Maven
Today I need to create a project using Maven. The command I use to create project is as below:
mvn archetype:generate -DgroupId=Your.Group.ID -DartifactId=Your.Artifact.ID -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
This tells Maven to create a Java project from the Maven maven-archetype-quickstarttemplate. If you ignore the archetypeArtifactId option, a huge list of the Maven templates will be listed.
However, I found it took a long time to build, actually, it seems stay in a step and didn't response at all. It doesn't make sense. Because Maven is supposed to be a handy tool.
After googling for a while, I found the solution to it. The root cause is when maven generate the project from the archetype, it will need to download a pom file from Maven repository, the pom file is really big(about 5 MB). The pom is :
You can download the above pom directly from above link, and put it into :
And then you build the project with
mvn archetype:generate -DgroupId=Your.Group.ID -DartifactId=Your.Artifact.ID -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeCatalog=local