Through the coordinate store, gav-groupid,artifacld,version
Some online warehouses are on their own, nexus,http://mvnrepository.com.
Transitive dependency
Range of dependencies:
Dependency transitivity: Dependencies are passed.
A--c,b--a, then b--c (delivery based on the compile range). Pom.xml in the scope if there is no declaration, then the default is compile
If the declaration of scope is test, then this dependency is not passed to another compile package
Test: When a war is made, it will not be hit in the package, nor will it be delivered. Neither compiling nor packaging will use this package.
Compile: The compilation scope is valid, in the compilation, the packing all needs
Provided: Valid during compilation and testing, and will not be added when the war package is last generated. such as: Servlet-api.jar because the Tomcat server already exists, if repackaging will conflict
Runtime: Run-time dependent, compile-time not dependent
Import
System
- Dependency transitive conflict
1, a--b1.0,b--b1.1 D--a and C, in D, which one depends on the order of first write to use the first write dependent version
If d--><d>a<d> and <d>b<d> then rely on B for 1.0
2, A--b1.0,b--b1.1,d--a and c==>b1.0,f-->d,c, select Shortest Path f--b1.1
3. If you want precise control of the dependency package, you can use the dependent exclusion function
Dependencies,dependency under exclusions, exclude packages that do not need to be relied on, Gav declaration
A place to compile multiple files, in Eclipse Maven follows project, and idea follows the module.
In eclipse, you can compile and package all project pom,<packaging>pom<packaging> by writing a Pom.xml (packaged method).
Idea, a project can have more than one module, so there is a default of Pom.xml
Parent class can be defined, version, encoding and other information, such as the introduction of the parent tag, will inherit the configuration
The parent class can import all the packages used, declare the dependencies through the dependencymanagement tag, and the subclass can only declare groupid and Artifactid to find the package, and the version inherits from the parent class.
Maven Getting Started Tutorial two----maven dependency