- 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.