JavaWeb(6)-Maven Setup and Quick Use

Download

Download maven from: http://maven.apache.org/download.cgi

Choose the Binary tar.gz archive, and extract it with tar xzvf apache-maven-3.3.9-bin.tar.gz

Edit the environment PATH

vim /etc/profile

Insert:

export MAV_HOME="/home/apache-maven-3.3.9"
export PATH="$MAV_HOME/bin:$PATH"

Save and update the profile

source /etc/profile

Confirm setup:

mvn -v

Succeed if some appears like this:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /home/apache-maven-3.3.9
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_111/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.8.0-41-generic", arch: "amd64", family: "unix"

Quick Use

clean workspace: mvn clean

compile and test: mvn install

skip tests: mvn install -DskipTests

skip test execution but compile: mvn install -Dmaven.test.skip.exec=true

clean and test: mvn clean install

run selected test after compile: mvn test -Dtest=TestClassName (combined: mvn clean install -Dtest=TestClassName)

create runnable binaries after install: mvn assembly:assembly -Pnative (combined: mvn clean install assembly:assembly -Pnative)

Done! Enjoy!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值