Reference Blog: http://www.linuxidc.com/Linux/2015-02/112712.htm
Here are a few common commands
MVN compile compiling the project
MVN test compile and run unit tests
MVN Package Packaging (jar or war)
MVN Install the project to the local warehouse
mvn Clean Empty Project
mvn eclipse:eclipse generate Eclipse Project
First download maven and unzip and move to the usr/local directory
$ wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.2. 3/binaries/apache-maven-3.2. 3-bin.tar.gz $ tar vxf apache-maven-3.2. 3-bin.tar.gz $ mv apache-maven-3.2. 3/usr/local/maven3
Modify the environment variables to add the following lines in the/etc/profile
Maven_home=/usr/local/maven3export Maven_homeexport Path=${path}:${maven_home}/bin
Remember to perform source /etc/profile the environment variables in effect.
Finally run mvn -v Verify that MAVEN is installed successfully and print the following if the installation is successful
Apache maven 3.2.3 (33F8C3E1027C3DDDE99D3CDEBAD2656A31E8FDF4; 2014-08-12t04:58:10+08:00) maven home:/usr/local/ Maven3java version:1.7.0_65, Vendor:oracle Corporationjava home:/usr/lib/jvm/java-7-openjdk-amd64/jredefault locale : en_US, platform Encoding:utf-8os name: "Linux", Version: "3.13.0-35-generic", Arch: "AMD64", Family: "UNIX" NOTE: input Sudu PA SSWD Root
Then follow the prompts to enter the password two times, you can establish the root account,
Then enter Su, as prompted to enter the root password just set, you can enter the root user.
Installation of Maven under Linux