Install maven3.0.4 in Windows + configure the local maven repository, maven3.0.4maven
Briefly describe how to install maven:
1. Before installing maven, make sure that JDK 1.6 and later are installed and the environment variables are configured.
2. Download maven3, the latest version is Maven3.0.4,: http://maven.apache.org/download.html
Download the apache-maven-3.0.4-bin.zip file and decompress it to D: \ cloud_cms \ maven \ apache-maven-3.0.4
3. Configure maven3 environment variables: first configure the M2_HOME environment variables, create a new system variable: M2_HOME, path is: D: \ cloud_cms \ maven \ apache-maven-3.0.4 ,:
Configure the path environment variable and add "% M2_HOME % \ bin" to the end of the path value, as shown in;
5. Click "OK" to open the cmd window: Enter mvn-version. The following content indicates that the installation is successful.
2012-09-07 Add:
ToMavenAdd local repository
1. open the locally stored maven directory (or maven installation directory, my installation directory is: D: \ cloud_cms \ maven \ apache-maven-3.0.4, there is not much impact, I only have different warehouses for different projects ):
For example, my local directory is: D: \ Util \ maven \ apache-maven-3.0.4
2. Open the settings. xml file in the conf folder, find row 53rd, remove the comment, and modify it:
<LocalRepository> D:/Util/maven-dependcies </localRepository>
Of course, the premise is that a folder named maven-dependcies is manually created under a path, and then the local repository is directed to the path.
- Copy the modified setting. xml file in the previous step to the Directory D:/Util/maven-dependcies;
- Modify the configuration of Maven in MyEclipse.
1. open myeclipse and click windows-> preferences-> maven-> installations to add a maven that has been installed in the D: \ Java directory, such as: D: \ Java \ maven-3.0.4, select this add item. And click the following browse button to open the maven global configuration file, such as: D: \ Java \ maven-3.0.4 \ conf \ setting. xml.
2. open myeclipse and choose windows> preferences> maven> User setting to change the user setting option to D: \ Java \ m2 \ repository \ settings. xml, and click update settings. Click the reindex button below to update the index.
3. Click the apply button in the configuration window to highlight the Configuration window.
Finally, open CMD and run mvn help: system. All jar packages downloaded by Maven from the remote database will be placed in the modified path D: \ Java \ m2 \ repository.