Maven 完全参考 学习笔记 (3) Project Object Model - Project Dependencies
- There are 4.5 types of dependence scope. compile(default), test[junit], provided[servlet], runtime[mysql-jdbc], system;
- you can define: Optional Dependencies. subproject or depends project will choose dependence;
- Version Ranges: (, ), [, ], [3.8,4.0), [,3.8.1], etc;
- 传递性依赖 和 冲突解析;
- Project relationship: depends, parent-child, project-subModule;
- Child POM inherits from its parent POM:
identifiers (at least one of groupId or artifactId must be overridden.)
dependencies
developers and contributors
plugin lists
reports lists
plugin executions (executions with matching ids are merged)
plugin configuration
- Maven assumes that the parent POM is available from the local repository, or available in the parent directory (../pom.xml) of the current project. Or you can use relativePath to customize:
<relativePath>../a-parent/pom.xml</relativePath>
- Best Practices:
Grouping Dependencies
Multi-module vs. Inheritance