Detailed maven frequently used commands (full version)

Detailed maven frequently used commands (full version)  

2012-11-26 17: 46: 47 | Category:  Maven  | Tags: Maven   | Report | font size  Subscribe

         Elsewhere to copy the maven project, sometimes there will be cases can not debug association, can not jump to the corresponding class or method that is after the hold down the ctrl key, which is needed to generate environmental eclipse Eclipse project files.

        Can enter the directory that contains the project maven pom.xml file in the cmd command window, run mvn eclipse: eclipse command can be, if not enough, you can use mvn compile: compile the source code commands.

 

 

--------------------------------------------------------------------------------------------------------------------------------

 

Maven Introduction

  • We use maven to build applications environment, so let's take a brief maven. What Maven is? How to answer this question depends on how you look at this issue. Most of Maven users to call Maven a "build tool": the source code used to build a tool to be released members. Maven would say is a more complicated thing to build engineers and project managers: a project management tool. So what is the difference? Ant build tool like this is only concerned preprocessing, compilation, packaging, testing and distribution, but such a Maven project management tool provides the tools to build a superset of the functionality provided, in addition to providing built functionality, Maven can also generate reports generating Web site, and help promote communication among team members.

  • Maven latest version is 2.1.0. Completely redesigned since version maven1.0 maven2.0 compared and faster than ever before, so called maven2. At present, many open source projects have adopted maven2 building, which shows the extent of popular easy to use.  Note: This guide mentioned maven refer maven2.

Here are some commonly used commands maven:

 

Maven2 run command: mvn,

Commonly used commands are:

             mvn archetype: create: Maven project

             mvn compile: compile the source code

             mvn test-compile: compile the test code

             mvn test: running the application unit test

             Web Site Builder project-related information: mvn site

             mvn clean: Clear produce results in the destination directory

             mvn package: jar file is generated according to the project

             mvn install: Local Repository mounted in the jar

             mvn eclipse: eclipse: generate Eclipse project files

Build the project

             JAVA build a project: mvn archetype: create -DgroupId = com.demo -DartifactId = App

          Build a web project: mvn archetype: create -DgroupId = com.demo -DartifactId = webapp -DarchetypeArtifactId = maven-archetype-webapp

 

Generate Eclipse project

Ordinary Eclipse project implementation: mvn eclipse: eclipse

           Eclipse WTP project implementation: mvn eclipse: eclipse -Dwtpversion = 1.0

 

Released 2726 original articles · won praise 781 · Views 2.8 million +

Guess you like

Origin blog.csdn.net/kwame211/article/details/104573386