The version of the Maven model. For Maven2 and Maven3, it can only be 4.0.0
groupId
Organization id, usually the reverse of the company domain name (xyz.cqulwj), or add the project name (xyz.cqulwj.Demo01)
artifactId
Project name, which is a subproject of groupId
version
The version number of the project, usually three digits, such as 1.1.0
packaging
Project packaging type, can be jar, war, rar, ear, pom default jar
The groupId, artifactId, and version constitute the coordinates of the project (unique identification)
1.2 Dependence
Logo
Explanation
dependencies/Dependency
Description of various resources to be used by the project. For example, mysql driver. Among them, <scope>test</scope> is the stage where the dependency works. There are three values: compile, test, and provided
Scope of dependence:
——
compile
test
provided
Is it valid for the main program
Yes
no
Yes
Whether the test procedure is effective
Yes
Yes
Yes
Whether to participate in packaging
Yes
no
no
Unfamiliar
Yes
no
no
1.3 Configuration properties
Logo
Explanation
properties
Define some configuration properties. Such as encoding method urf-8
1.4 Build
Logo
Explanation
build
Maven configuration information during project construction. Such as jdk version, etc.
1.5 Inheritance
build
1.6 Aggregation
modules
2 Maven commonly used commands
command
Features
Mvn compile
Compile the main program (target is generated in the current directory)
Mvn clean
Clean up, delete the compiled directory, but the warehouse package will not be deleted
Mvn test-compile
Compile the test program and generate the target, but it is a test program
Mvn test
Perform tests, generate test reports, surefire-reports, save test results
Mvn package
Package the main program and generate the jar package or war package according to the configuration
Mvn install
Install the main program, package this project, and install it to the local warehouse according to the coordinates
Mvn deploy
Deploy the main program, package -> put in local library -> save to private server -> deploy to web container
3 some knowledge points
3.1 Package management search logic: local warehouse -> private warehouse -> remote mirroring -> central warehouse. 3.2 Global variables can be defined in the configuration, such as <name>1.0.2</name>, and then used with ${name}. 3.3 During compilation, non-.java files in main/java will not be processed by default. If necessary, configure resource in pom.