Fastest way to generate template project:
http://blog.csdn.net/uncleja/article/details/7252780
1. Configure the template project
2. Open the cmd window, cd to the root directory of the maven project you just created, and run the maven command:
mvn archetype:create-from-project
will then generate the generated-sources directory under the target directory, which is the generated archetype
3. cd into the generated-sourced/archetype directory and run the maven command: mvn install
The maven template project can be generated.
If you want to publish to private server, use maven deploy.
==============================================================================
When generating a skeleton, I encountered the problem of " archetype catalog is not supported anymore " Solution:
When we use the maven prototype to generate the project skeleton, it is often very slow in [INFO] Generating project in Interactive mode. This is not the reason for the error to get stuck. You can open the debug mode of mvn and see the following information: [DEBUG] Searching for remote catalog: http://repo.maven.apache.org/maven2/archet ype-catalog.xml
At this time, we can download the archetype-catalog.xml file and put it in the root directory of the maven repository. Such as .m2 or a user-defined maven repository.
Then we add -DarchetypeCatalog=local when using mvn archetype:generate, then mvn will use the local prototype data for you to choose the prototype of the generated skeleton.