Tips [IDEA] (3) - IntelliJ IDEA Maven configuration

1.IntelliJ IDEA Maven configuration

1.1. Maven Introduction and download

Maven is a project management tool, use it to manage the project for Java project to build a jar, a good solution to the conflict jar package using the traditional project approach in the management pack guide jar package caused.

 

Maven can be downloaded directly to the official website of Maven download, download address:

https://maven.apache.org/docs/history.html, we generally use the Maven 3.3 version can download the .X.

 

 

Note: The current version 3.6.1 can be acquired in the official Apache Maven Link directly online resource for download, and 3.3.9 of the resources you need to download through the official website mirroring Address: http://mirror.bit.edu.cn/apache / maven / maven-3 /

 

 

 

 

Here we choose the Binaries / , select bin.zip download can be.

 

 

Select the second can be downloaded:

 

 

Special attention : here can not choose the source / directory src.tar.gz or src.zip package to download, because bin directory structure of this package have already changed the configuration will appear in the windows system - mvn -v error : Can not find or load the main class org.codehaus.plexus.classworlds.launcher.Launcher problem.

 

 

1.2. IDEA disposed SDK

After we described earlier JDK installed, IDEA will automatically recognize the JDK version of the project to build, but to set the global SDK, add different versions of the JDK still need to set our own, in a word, their allocation more comfortable! Here we take a look at the specific steps to configure the SDK:

① Select File-Project Structure, select SDKs can be configured globally SDK environment;

 

 

Corresponding to the item ② SDK Project Modules level and configuration module can be disposed below the corresponding configuration;

 

1.3. Maven installation and configuration

Apache-maven-3.3.9-bin.zip download compressed after installation in the local disk D can extract,

 

Maven environment variable configuration:

① computer Right - Properties, select Advanced System Settings - environment variables, create a new MAVEN_HOME variables in the system variable, the variable value is the current directory src maven installation of:

D:\apache-maven-3.3.9

 

 

 

 

② configure the value of the system variable Path in the installation directory maven, maven ensure that every place can be used in the system, specific ways: Edit the Path variable, the last value in a variable: ;% MAVEN_HOME% \ bin

 

 

 

③ detecting apache-maven-3.3.9 successful installation environment:

 

cmd command window: mvn -v (or mvn -version), i.e. if the following display appears Maven installation configuration showing local system successfully.

 

1.4. IDEA configure Maven

Before IDEA configure Maven, we first priority is to configure maven settings.xml file in the installation directory, first of all we have to back up a file settings.xml bak in the conf directory:

 

Then open the settings.xml modify two main configurations:

① localRepository

 

 

Modify as follows:

 

 

②mirrors

 

 

Modify as follows:

 

Learn more maven-settings.xml configuration can be found in blog:

https://www.cnblogs.com/s1165482267/p/7928275.html

 

Second IDEA tool disposed in the developer maven directory, settings for a tool to automatically build maven items, setting is as follows: File-Settings-Build, Execution, Deployment, select Maven, Maven in FIG provided to complete the make IDEA on the set:

 

Guess you like

Origin www.cnblogs.com/yif0118/p/11516200.html