MAVEN's authoritative Guide to learning Notes (iii)--A simple MAVEN project

Source: Internet
Author: User

Goal:

There is a basic understanding of the build life cycle (build lifecycle), MAVEN Warehouse (repositories), dependency management (dependency management), and project object model.

Currently not ready to delve into Maven so use tool Ideaj to help with learning,

Create a default Maven project with idea, with the following structure:

Related commands:

Packaging: MVN Package

Compilation: MVN compile

Compiling the test program: MVN test-compile

Empty: mvn Clean

Run Test: MVN test

Build Site Directory: MVN site

Build the Site Directory and publish: MVN Site-deploy

Install the current project's output file to the local repository: mvn install

Install the specified file to the local repository: mvn install:install-file-dgroupid=<groupid>-dartifactid=<artifactid>-Dversion=1.0.0- Dpackaging=jar-dfile=<myfile.jar>

View actual pom information: mvn help:effective-pom

Analyzing dependency information for a project: mvn dependency:analyze or MVN dependency:tree

Skip test run Maven task: Mvn-dmaven.test.skip=true XXX

Build Eclipse Project file: mvn eclipse:eclipse

View Help information: mvn help:help or MVN help:help-ddetail=true

Check the plugin's help: Mvn <plug-in>:help, such as: mvn dependency:help or mvn ant:help, etc.

Common commands

1. Create a generic Java project for Maven:

MVN archetype:create

-dgroupid=packagename

-dartifactid=projectname

2. Create a MAVEN Web project:

MVN archetype:create

-dgroupid=packagename

-dartifactid=webappname

-darchetypeartifactid=maven-archetype-webapp

3. Compiling source code: MVN Compile

4. Compiling test code: MVN test-compile

5. Run the test: MVN test

6. Generate SITE:MVN Site

7. Packaging: MVN Package

8. Installing the JAR:MVN install in the local repository

9. Clear the resulting project: MVN clean

10. Build Eclipse Project: MVN eclipse:eclipse

11. Generate the Idea project: MVN Idea:idea

12. Combine with goal commands, such as package-only not tested: Mvn-dtest packages

13. Compile the content of the test: MVN test-compile

14. Only hit jar package: MVN Jar:jar

15. Test without compiling and not compiling: mvn test-skipping compile-skipping Test-compile

(-skipping's flexible use, of course, can also be used for other combination commands)

16. Clear some system settings for Eclipse: mvn Eclipse:clean

Reference: Maven Learning note-maven The Install module references each other http://blueyan.iteye.com/blog/1999159

Maven's authoritative Guide to learning Notes (iii)-A simple MAVEN project

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.