Maven installation

check JDK and environment configuration
1. open cmd
2. echo %JAVA_HOME & java -version
C:\Users\XXX>echo %JAVA_HOME%
D:\Program Files\Java\jdk1.7.0_09

C:\Users\XXX>java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)


maven installation
1. download http://www.apache.org/dyn/closer.cgi/maven/maven-2/2.2.1/binaries/apache-maven-2.2.1-bin.zip
2. unzip to D:\Program Files\apache-maven-2.2.1
3. create new environment variable M2_HOME, point to D:\Program Files\apache-maven-2.2.1
4. add to path %M2_HOME%\bin
5. check whether the installation is successful, open cmd

C:\Users\XXX>echo %M2_HOME%
D:\Program Files\apache-maven-2.2.1

C:\Users\XXX>mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.7.0_09
Java home: D:\Program Files\Java\jdk1.7.0_09\jre
Default locale: en_US, platform encoding: GBK
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"


installation plugin m2eclipse
1. open Eclipse
2. Help - Install New Software
3. click add and in location input: http://m2eclipse.sonatype.org/sites/m2e



4. select "Maven Integration for Eclipse"
5. then step by step until ending installation
6. check whether it is successful
1)Help - about eclipse -install details, if exists Maven Integration for Eclipse(Required)
2)check if it can create maven project




configuration
1. open home maven folder:C:\Users\XXX\.m2\settingd.xml(win7 location)
  change <localRepository>D:/MavenRepository</localRepository>
this we designated lacal warehouse is D:/MavenRepository




猜你喜欢

转载自smallwildpig.iteye.com/blog/1725444