Integrating Maven
During project development, we rarely use Maven with IDEA. Instead, we install Maven locally and then configure and integrate the locally installed Maven on IDEA. After the integration, you can directly click the mouse on IDEA to complete the compilation, testing, packaging, installation and other processes of the project, without the need to enter MVN commands through the command line, which is very convenient and fast.
1. Configure Maven Home and local repository
File – – > Settings – > Build, Execution, Deployment – > Build Toos – > Maven, then set the Maven home directory for the local Maven installation directory, Set the User Settings file to the local Maven configuration file and click “Ok” to complete the configuration.
2. Set VM Operation parameters
File – – > Settings – > Build, Execution, Deployment – > Build Toos > Maven — – > Runner, and then select the version of the JRE, Add the parameter -DarcheTypecatalog =internal to VM Options and click “Ok” to complete the configuration.
Description: Why add the -darcheTypecatalog =internal parameter?
Because every time Maven project is created on IDEA, it is essentially done by executing the command MVN archetype:generate, which requires the archetype-catalog.xml file. The -darchetypecatalog parameter is used to specify the location of the archetype-catalog. XML file. The options are remote, internal, local, etc. The default value is remote, that is, download the archetype-catalog.xml file from the remote repository, which is slow. Therefore, to speed up the creation of Maven projects, set the value of -darchetypecatalog to internal in IDEA.