Maven-key notes, maven-Key Points
-- Maven notes
1. maven command
2. archetype Plugin: used to create a directory skeleton that complies with maven requirements
Command: mvn archetype: generate
3.
Coordinates: Component
Repository: local repository and remote Repository
Image repository: http://maven.net.cn/content/groups/public
Change the location of the local repository
4. maven lifecycle:
Clean Project
Pre-clean
Clean clears the last build-generated file
Post-clean
Default build project (CORE)
Compile test package install
Site generation project site
Pre-site: the work to be done before the project site is generated
Site: generate the site file of the project
Post-site
Site-deploy
5. Some plug-ins provided by maven
6. pox. xml parsing:
Set whether dependency is optional
<Optional>
Exclude dependency transfer list
<Exclusions> <exclusion>
Dependency Management
<Dependencies> <dependency>
Plug-ins
<Build> <plugins> <plugin>
Child module inherits parent Module
<Parent>
Module
<Modules> <module>
Dependency scope: -- parameter (compile (default) \ provided (valid for compilation and test) \ runtime (test, run) \ test (test) \ system (compilation, test, portable difference) \ import (import range, only used in dependencyManagement, indicating to import dependency configuration from other pom ))
<Scope>
Dependency transmission:
Dependency conflict:
Principles:
Short Circuit priority,
First declare first priority (same path length)
7. Aggregation and inheritance
Aggregation (modules module tag)
Inheritance
For example:
-- Parent class pom:
<Properties>
<Junit. version> 4.0.0 </junit. version>
</Properties>
<DependencyManagement>
<Dependencies>
<Dependency>
<GroupId> junit </groupId>
<ArtifactId> junit </artifactId>
<Version >$ {junit. version} </version>
</Dependency>
<Dependencies>
</DependencyManagement>
-- Subclass pom:
<Parent>
Parent pom Coordinate
</Parent>
8. maven uses Jetty and tomcat services to run web projects
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.