Maven simple usage

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

 

Start up steps:

 

Step 1) download maven from http://maven.apache.org onto your local drive

 

Step 2) setup environment variable M2_HOME=C:\apache-maven-2.0.9

 

Step 3) update environment varialbe path=%path%;%M2_HOME%\bin

 

Step 4) enter dos cmd

 

Step 5) go to some newly-created folder. issue command "mvn--version"  to check maven version

 

Step 6) issue command "mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app" to create a new sample project

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

 

Command list:

 

For some of them, to issue a command, you need to first go to any folder which contains pom.xml.

 

creat sample application: mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app

build using maven: mvn package

check maven verion:  mvn --version

create project site: mvn site

 

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

 

About phase:

 

Phase is a sequence list. The sequence list is:

validate, compile, test, package, integration-test, verify, install, deploy

 

if you issue: mvn validate, it will run mvn validate

if you issue: mvn compile, it will run mvn validate, and then, mvn compile

if you issue: mvn deploy, it will run all of them, in sequence.

 

Except the above sequence, there are another 2 : clean and site.

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

Usful site:

 

Maven in 5 minutes: http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

Maven getting started Guide: http://maven.apache.org/guides/getting-started/index.html

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值