As a project building tool, Maven is popular in the development process to help manage Bao dependencies in your project, and many of its features greatly reduce the difficulty of development, as described in Maven installation and integration with Eclipse.
MAVEN's official website address is: http://maven.apache.org/, after opening the Web page, See the latest version is 3.3.9, from the 3.3.9 version of the introduction, you can know that more than 3.3 of the version needs JDK1.7 support, the following is the support of the JDK required by the version of Maven, I am here on the computer is JDK1.6, so I download here is 3.2.2 version of Maven.
Since MAVEN requires JDK support, make sure that you have the JDK installed on your computer before installing MAVEN, and that you have configured the environment variables, and that the installation and configuration of the specific JDK will be self-Baidu. Enter the installation below
One, MAVEN installation
The appropriate version of MAVEN has already been downloaded, and the JDK environment has been configured;
1, the download good compressed package to a path, I am here to extract the path is: e:\maven\apache-maven-3.2.2,
2, after the decompression needs to configure the environment variables, the new maven_home environment variable, the value is: e:\maven\apache-maven-3.2.2, and then to the PATH environment variable value of the last add the following:%maven_home%\bin; Note that when adding values to path, different values need to be separated by semicolons in the English state, and the last value needs to end with a semicolon, click OK to complete the configuration of the environment variable.
3, test, enter in the command line: mvn-v, enter, if it appears as shown, it proves that MAVEN installation is successful,
After MAVEN installation is complete, you can use MAVEN to create a project, build projects, and so on independently. This is not the way to use it alone, and here's how it integrates with Eclipse.
Ii. Integration with Eclipse
Eclipse is an integrated development environment that is used extensively in the development process and below to see how maven is used in eclipse. More than 4.4 of the Eclipse version added support for MAVEN, i.e. no need to install MAVEN plug-ins, but for versions below 4.4 You need to install the plugin yourself at the following URL: http://marketplace.eclipse.org/content /maven-integration-eclipse-luna, to understand the installation process, after the installation is complete,
1. In Windows-->>preferences, find the MAVEN option,
We found Maven-->>installations, we've got it, but we're going to use the Maven we just installed, choose the Add button, and find the path to the maven you just unzipped, like,
Since I have already installed this, so the hint already exists, after modifying the location of MAVEN, we need to modify the configuration file
2, modify the configuration file, find Maven extract directory, and then into the Conf folder, Edit Settings.xml, find the commented out localrespository tag in Settings, the purpose of this tag is to configure the local MAVEN repository, we add such a configuration: <localrepository>e:/ Apache-maven-3.3.1-bin/mvn/mvnrepository</localrepository>, which is to set the local repository to my local directory. Then save it.
3. Update the configuration file in eclipse
Windows-->preferences in Eclipse, find Maven and, as shown, find the user settings, modify the configuration file for the profile you just modified,
After the modification is complete, integration with Eclipse is complete.
After the steps above, MAVEN and Eclipse are integrated, then MAVEN is available, but if your computer is online via proxy, You must configure the agent in the settings.xml file so that you can download the required files from the MAVEN repository and configure the proxy as follows, adding the following in the settings.xml file.
<proxy> <id>myProxy</id> <active>true</active> <protocol >http</protocol> <username></username> <password></password> < host>proxy.xxxxx910</port>
ID Agent ID identifies the agent
Whether the active settings agent is enabled
protocol used by the Protocol agent
Username the user name of the connection agent, if the agent does not require a user name, you can delete this tag
Password The password of the connection agent, e.g., ibid.
Host agent's URL
Ports used by the port agent
Above is the use of proxy Internet configuration, if the Internet does not use a proxy, you do not need to configure.
Iii. creating a project using Maven
Java, Javaweb projects are the most used in the development process,
File-->>new--->project, and then find Maven, as selected,
Click Next,
When you click Next,
The first red box represents the new Java project, the second is the Javaweb project, where the first one is selected,
After entering the contents of the Red box, click Finish,ecplise to start creating the project, which will connect the network to download the required jar package, the path of the jar package is the path of the configured local repository, my: E:\apache-maven-3.3.1-bin\mvn Under the \mvnrepository path, under the E:\apache-maven-3.3.1-bin\mvn\mvnrepository\org\apache\maven\plugins folder is the dependency plug-in required by the MAVEN plugin.
The MAVEN environment has been set up and a MAVEN project has been created, followed by Maven's use, next time.
There is an undesirable place to welcome the point, thank you!
One of Maven: Maven installation and Eclipse integration