a MAVEN environment setup
1 Download the following software:
1) Maven software: apache-maven-3.1.0-alpha-1-bin.tar.gz
Download Address: http://maven.apache.org/download.cgi
2) Plug-ins integrated with eclipse: eclipse-maven3-plugin.7z
Download Address: http://115.com/file/dpk80gj0#eclipse-maven3-plugin.7z
2 Configuring the Environment
1) configuration Java_home,maven will use this, do not configure the following will be an error.
2) Configure MAVEN into the environment variable
Unzip the apache-maven-3.1.0-alpha-1-bin.tar.gz file
Add the following environment variables:
; E:\mavon\apache-maven-3.1.0-alpha-1-bin\apache-maven-3.1.0-alpha-1\bin
Remember that there is a semicolon in front.
3 See if the environment variable is tested successfully
CMD under input command
Mvn–v
The following information appears:
4 Set up the warehouse and change the files in the Conf directory settings.xml
Add the warehouse location and name Repo first, then set the warehouse location, change the settings.xml file
The warehouse location for this example is placed in:
E:/mavon/apache-maven-3.1.0-alpha-1-bin/repo
This example is configured as follows:
5 Viewing Java system environment variables
Enter the following command:mvn help:system, as shown in the following figure
6 Creating a project
Input command
mvn archetype:create-dgroupid=com.chongshi.test
-dartifactid=hello-dpackagename=com.chongshi.test-dversion=1.0
This will generate a Hello project, in My computer is placed in C:\Documents and SETTINGS\CHAIGW this directory 7 compiled
The pom.xml file under the Hello project needs to be copied to C:\Documents and SETTINGS\CHAIGW before compiling
Otherwise compile the time will not find the Pom.xml file and error.
The input command clears (clears the previously compiled file before compiling) and compiles
mvn Clean Compile (To compile),
mvn eclipse:eclipse (This command in order for the project hello to be added to eclipse)
Note: The above document mainly refers to the following linked documents, because this document is more detailed, if there is unclear please see the original file
http://www.cnblogs.com/fnng/archive/2011/12/02/2272610.html two eclipse integrated maven
1 Installing the eclipse-maven3-plugin.7z plug-in
First unzip the plugin, there will be two files features and plugins,
Features and plugins files are checked into the Eclipse directory under features and plugins (other plugins can also install)
2 Restart Eclipse, if you encounter a problem see FAQ 3 configuring Eclipse maven
Eclispe will have maven directory in Window->proferencesà after reboot.
The following two-step configuration is required
1) Click Mavenàinstallation-àadd to add Maven path
As shown in the following illustration:
2) Configure Settings path
Select the path under Mavenàuser settings:
After two steps above, MAVEN's plug-in is completely installed.
Note: Here is the main reference to the following documents, if unclear please see the original file
http://www.blogjava.net/fancydeepin/archive/2012/07/13/eclipse_maven3_plugin.html III: Use of MAVEN four frequently asked Questions FAQs 1 After configuring the plugin will prompt the following warning
This indicates that the plugin depends on the jar file cannot be found because the path of the JDK is not set
The solution requires two steps
1) Configure the JDK, (run with JRE, develop with JDK, here to configure the path of the JDK, because the MAVEN plugin is used to the JDK jar file
2) Under Eclipse Development tools, open the Eclipse.ini
Add the following selected sentence,
Restarting eclipse will solve this problem.