Nine, IDEA-- configuration and create a new Maven Modlue

1. Maven Introduction
Make -> Ant -> Maven - > Gradle

Apache Maven is to provide an automated build tools for building and dependency management automation.
D team without spending much time will be able to automatically complete basic engineering build configuration, because == Maven
IntelliJ IDEA installation, configuration and use of a standard directory structure and build lifecycle of a default. == In the following session, Maven enables developers to work easier.
Build links:
Here Insert Picture Description
clean up: that before compiling code generated content before deleting the
compiler: the source code is compiled into bytecode
test: run the unit test program
results of the test program: report
Packaging: The java project labeled jar package; Web project will be labeled as war package
Installation: The jar or war generation to the Maven repository
deployment: The deployment jar or war from the Maven repository to a Web server running

2. Maven configuration
path
File-settings-Build, Execution, Deployment-build Tools-maven
to choose their own Maven directories, files and settings, and then configure its own warehouse reposiroty.

Here Insert Picture Description
Maven home directory: You can specify where the local Maven installation directory, because I have configured
M2_HOME system parameters, so this configuration directly IntelliJ IDEA can be found. But if you do not have to configure it, where you can choose your Maven installation directory. In addition, it is not advisable to use IDEA default.
User settings file / Local repository: We can also specify Maven's settings.xml location and local warehouse location.
Here Insert Picture Description
Import Maven projects automatically: pom.xml file IntelliJ IDEA will represent real-time monitoring of the project, change the project settings.Recommend Check
Automatically download: import Maven dependencies when whether to automatically download the source code and documentation. The default is not checked,Not recommended checkBecause this can speed up the project dependencies are imported from outside the network speed, if we need the source code and documentation that time again when we can be networked to download for a certain dependencies. IntelliJ IDEA supports directly from the public network to download the source code and documentation.
VM options for importer: VM can set the parameters to import. Generally you do not need to take the initiative to change this, unless the item
project really slow import we'll increase this parameter.

3 Create the corresponding Module
Here Insert Picture Description

Here Insert Picture Description
For example: At this Spring Initalizr template springboot project.

Here Insert Picture Description
Group: Organization or company domain name, descending
Artifact: Project Name Module
Version: default maven build version: 0.0.1-SNAPSHOT

Here Insert Picture Description
Here we can not vote for being the first, followed by the re-development needs to be set.
Here Insert Picture Description
Click finish to complete the creation.
Here Insert Picture Description
After the creation is complete, you can see Module created on the right IDEA. If not, you can refresh.
There will be a corresponding life-cycle directory. Which are commonly used are: clean, compile, package, install .
For example, here install, if the other items you need to use the module as a dependency here, it can install.
Installation location to a local warehouse.
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/m0_38143867/article/details/92788728