Maven initial setup (1): maven setup

Source: Internet
Author: User

Maven initial setup (1): maven setup

What is maven?

Maybe a lot of people started with me. After reading a lot of projects, they didn't know what the bird was! :-D

There is a reason why something appears, for example, Linus writing git.

 

Maven project Object Model (POM) is a software project management tool that manages project building, reporting, and documentation through a short description.

In short, it is a project management tool. In the subsequent frameworks (Struts, Spring, and Hibernate.

In the initial stage, we need to build a maven repository in myeclipse.

 

1. You can download a maven file from the official website, decompress it, and install it. (I am using a maven-3.3.9) 2. Configure the maven environment variable path after the download.

Open the configuration file in linux:

 

Insert the following path name: (JAVA_HOME is the JDK path. Only one maven path, M2_HOME and MAVEN_HOME, can be used)

 

 

3. Modify the maven local repository: (it is not necessary. If you do not modify the repository, maven uses the default repository)

In the downloaded maven file directory, there is a conf configuration folder to modify the content in its setting. xml file:

------> Before modification: (you can see that maven uses the default repository)

 

Go to the default repository of maven, and we will see that many files are saved in it, and the local repository is modified later. If these files are missing, maven cannot run normally.

 

------> After modification: (Note that after you modify the target path you want to save, you need to move the original annotator up, that is, the content in the first parentheses in the figure)

 

4. Configure Maven plug-in MyEclipse

Open MyEclipse ---> widnow ---> preferences ---> myeclipse ---> maven4MyEclipse ---> Installations ---> add --->

Select the mavenl that has been decompressed and installed in step 1 ---> finish ---> OK

 

5. maven4MyEclipse ---> select User Settings ---> select/conf/Settings under the Maven installation directory in the User settings column on the right. in the xml configuration file ---> Local Repository, select the path of the file where the new Local Repository is located (if not modified, use the default Repository location) ---> OK

 

6. choose Window ---> preferences ---> java ---> BuildPath ---> Classpath variables ---> select the m2_repo item ---> edit ---> change it to the path of your local repository (if it is the default repository) it does not need to be modified .) ---> OK

 

7. The setup process is complete.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.