Introduction to the Maven plugin, installation and configuration in eclipse

Source: Internet
Author: User
Tags aliyun


1.Maven Introduction


1.Maven Introduction



Maven is an open source project management tool for pure Java development based on the concept of the Project object model (Pom:project object models). MAVEN Pumps Our project like an object, "store" in pom.xml, maven resolves Pom.xml and uses the engineering coordinates to manage the project.



2.Maven main functions



1. Mainly used to manage Java projects, rely on management (jar package management, can automatically analyze the project's required dependencies and download to the Maven warehouse area)
2. Project Building build (Project packaging and Deployment)
3. Sub-module development



In simple terms, it is easy to manage the jar package, just know the project coordinates, the Pom.xml file can be introduced to automatically download the relevant jar package.


2.Maven Installation


1. Go to http://maven.apache.org/ to download






2. Unzip the downloaded compressed package (try to put the package in English path)



3. Need to configure environment variables for MAVEN



1. Right-click My Computer (or computer)-Properties-Advanced system Settings-advanced-environment variables-system variables-new maven_home, with a value of MAVEN's installation directory
2. Append the%maven_home%\bin to the value of the PATH variable
3. Verify the success of:cmd-> Mvn-v (if the version number appears, the installation is successful)


3. Configure in Eclipse


1. Create a folder in the Maven directory to store the jar package as a local repository (the folder name is the English character). If not created, the default local warehouse in the C drive, after the jar package more, C disk too many things, the computer is too much.






2. Configure settings.xml in the Conf folder to tell Maven that I created the local repository. Add the following code to the Settings tab


< localrepository > The path of your local repository on disk </localrepository>


3. In Settings.xml, tell maven which version of JDK I used (default is 1.5), add in profiles tag, what version of your JDK, and modify it to jdk-x.x


<!-- maven compiled Yi Java Project dependent JDK environment  - <  Profile >
  <id>jdk-1.8</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
        </activation>
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
        </properties>
    </profile>


4. In the Setting.xml file, configure the Ari image in the mirrors tag to greatly increase the download speed of the jar package.


 
<mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
</mirror>


5. The configuration file is complete, open eclipse->window->preferences-> search maven->installations






6. Then go to User Settings, and click OK when the settings are complete.












With this, MAVEN's configuration is complete and the Maven plugin can be used happily in eclipse.



Introduction to the Maven plugin, installation and configuration in eclipse


Related Article

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.