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 website address is: http://maven.apache.org/
The download steps are as follows:
go to the official website, click to download go to the download page and click on the image package Select Maven Package Select Maven Version Select a compressed resource bundle Select a resource
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 is already 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.
new maven_home environment variable Configuring environment Variables
3, test, enter in the command line: mvn-v, enter, if it appears as shown, it proves that MAVEN installation was successful.
Test maven Installation
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. Find the MAVEN option in Windows->preferences, as shown in
Eclipse configuration maven
We found Maven->installations to see that already there, but we're going to use the MAVEN that we just installed, select the Add button, and find the path to the maven you just unzipped, as shown in
Eclipse configuration maven
Since I have installed it here, 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: e:/apache-maven-3.3.1-bin/mvn/ Mvnrepository, set the local repository to my local directory and 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,
Eclipse configuration maven
After the modification is complete, integration with Eclipse is complete.
After the steps above, MAVEN and Eclipse are integrated, and MAVEN can be used next. However, if your computer is online through a proxy, you must configure the agent in the settings.xml file, so that you can download the required files from the MAVEN repository, configure the agent as follows, add the following in the Settings.xml file,
<Proxy> <ID>Myproxy</ID> <Active>True</Active> <Protocol>http</Protocol> <username></username> <Password></Password> <Host>Proxy.xxxxx</Host> <Port>910</Port> </Proxy>
The ID Proxy ID identifies whether the agent active Settings agent enables the Protocol agent to use the Protocol username the user name of the connection agent, such that the proxy does not require a user name to delete this label password The password of the connection agent, for example, the port agent used by the URL of the host agent.
上面是使用代理上网的配置,如果上网没使用代理,则不需要配置。
Iii. creating a project using Maven
- Java, Javaweb projects, File->new->project, and then Maven, as selected,
maven Create Project
maven Create Project
maven Create Project
- The first red box represents the new Java project, the second is the Javaweb project, where the first one is selected,
maven Create Project
- 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 built and a MAVEN project has been created.
Springboot Learning--01 Basic Configuration--maven Configuration