Maven experience (1)-install the maven plugin

Source: Internet
Author: User
    • Maven is often used for development in IDE. Currently, popular Java ides include eclipse and intellij. For Maven, we can divide the IDE into two types:

1. Eclipse and other Maven integrated IDE are not close enough.

The combination of eclipse and Maven is not good. If you want to use Maven in eclipse, you need to install the plug-in: m2e

After installing this plug-in, you can view the maven menu in eclipse, create a Maven project, and execute Maven goal.

To use Maven in the command line, we often install a Maven program locally. In this case, there will be a problem: when running Maven goal in eclipse, you can choose to use embedded Maven, or you can choose to install Maven separately. As follows:

In order to use Maven in the command line to achieve the same effect as executing Maven goal in eclipse, we recommend that you select an independently installed Maven in eclipse instead of an embedded Maven.

2. intellij, netbeans, and other close ides.

In intellij IDE, you do not need to install the maven plug-in separately. We still need to install Maven by ourselves, and we can also configure the maven used (by default, the environment variable m2_home ):

    • When importing a Maven project, you often need to download the dependency that is not in the local repository. If repository cannot be connected to the Internet, we can:

1. Open Maven settings. xml and configure the proxy. Or let Maven download the specified repository. Note that Maven has the default settings. xml file in the conf directory of Maven home.

User settings. XML does not exist by default, but can be created and will overwrite the default settings. xml

2. After the modification, run mnv package on the command line to download the package again. I have encountered in intellij idea that Maven cannot download all dependency, but it can be executed in the command line. It may be related to ide and Maven integration.

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.