Maven2 has an increasing influence on project management, and maven2 is used in many projects. Next we will introduce how to use maven2 to quickly create a project prototype and then develop a project based on it. Next we will take a look at how to use maven2 to create a typical three types of projects:
Common Java projects, such as basic packages:
MVN archetype: Create-dgroupid = com. yourcompany-dartifactid = myproject-darchetypeartifactid = Maven-Archetype-Quickstart
A common web project, such as a web project:
MVN archetype: Create-dgroupid = com. yourcompany-dartifactid = myproject-darchetypeartifactid = Maven-Archetype-webapp
Struts 2.0 project in appfuse:
MVN archetype: Create-darchetypegroupid = org. appfuse
-Darchetypeartifactid = appfuse-Basic-struts
-Dremoterepositories = http://static.appfuse.org/repository
-Darchetypeversion = 2.0-m4-SNAPSHOT-dgroupid = com. mycompany
-Dartifactid = myproject
After using the above command, you can quickly generate the project prototype you want. Next, we only need to use the following command to generate the IDEA project file, and then open it to perform project development under idea.
MVN idea: idea-ddownloadsources = true-ddownloadjavadocs = true-djdklevel = 1.5
When pom. when the XML file changes, we only need to use the following command to regenerate the module file. The newly generated module file will be well merged with the original module File, the dependent package is usually changed.
MVN idea: Module