"Maven" in IntelliJ, experience maven

Source: Internet
Author: User

1: Configure Maven

Download from the official website and add the bin directory to the system variable path.

In the cmd window, enter MVN, and the execution feedback is configured successfully.

Configure the Conf/settings.xml file to specify the repository center to download to a local directory

<localRepository>E:\MavenRepo</localRepository>

2: Experience maven in IntelliJ

Create a new Java project and choose Maven, all the way next.

Build a good root directory pom.xml, add dependencies

 <Properties>        <dropwizard.version>0.7.1</dropwizard.version>    </Properties>    <Dependencies>        <Dependency>            <groupId>Io.dropwizard</groupId>            <Artifactid>Dropwizard-core</Artifactid>            <version>${dropwizard.version}</version>        </Dependency>    </Dependencies>

Right-click to select maven->reimport; if there is no directory locally, it will take time to download it from the Web.

Wait for the execution to succeed. You can use a dependent package in your project.

3: summary

Multiple projects can share a local warehouse, and no need to manually add jars to classpath.

This is just one of Maven's many skills in project management tools, and it's worth learning.

"Maven" in IntelliJ, experience maven

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.