Transfer: https://blog.csdn.net/shikongshengzhu/article/details/51779159
Installation of MAVEN and configuration and use of Myeclipse+maven
Proceed as follows:
maven installation
- Download maven Download apache-maven-3.3.9-bin.zip
in https://maven.apache.org/download.cgi and extract it directly to the local. - To configure environment variables
, please confirm that jdk1.7 or above has been installed and JAVA_HOME is configured.
Configure the environment variable MAVEN_HOME, such as F:\maven\apache-maven-3.3.9, my decompressed files are placed under F:\maven, so the path is as above.
Configure Path, add %MAVEN_HOME%\bin at the end. - Open cmd and enter mvn -version to get the following:
So far, the maven installation is successful!
Using maven in myeclipse2014
Since the maven4myeclipse of myeclipse2014 is not very easy to use, it is not avoided that the two different versions of maven have different project rules, so the maven in myeclipse2014 is also changed to maven3.3.9 that we installed above
-
Configure maven
to open window–>preferences–>MyEclipse–>Maven4MyEclipse as shown below:
Click the Add button in the upper right corner and select the root directory of maven installed above (my directory is F:\maven\apache-maven-3.3.9) -
Set up maven's central repository
maven4myeclipse has the default warehouse address, in the user file .m2 directory, here we define the directory ourselves.
First, create a new central warehouse (store the jar package to be loaded by the project), my directory is F:\maven\m2\repository, and then configure settings.xml from F:\maven\apache-maven-3.3.9\conf Copy the file to F:\maven, then open the copied settings.xml file, change the value in the localRepository tag to F:\maven\m2\repository, if the localRepository tag is commented out, open the comment, this The first step is to designate the central warehouse.
Then, enter the following interface
Reconfigure settings.xml as shown.
In the last step, enter the following figure
to replace the default jdk with the jdk configured in the environment variable, and set the Default vm arguments as shown in the figure below.
At this point, the maven configuration in myeclipse2014 has been completed.