Use maven2 to quickly create a project

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.