Maven 完全参考 学习笔记 (3) Project Object Model - Project Dependencies

  1. There are 4.5 types of dependence scope. compile(default), test[junit], provided[servlet], runtime[mysql-jdbc], system;
  2. you can define: Optional Dependencies. subproject or depends project will choose dependence;
  3. Version Ranges: (, ), [, ], [3.8,4.0), [,3.8.1], etc;
  4. 传递性依赖 和 冲突解析;
  5. Project relationship: depends, parent-child, project-subModule;
  6. Child POM inherits from its parent POM:
    identifiers (at least one of groupId or artifactId must be overridden.)
    developers and contributors
    plugin lists
    reports lists
    plugin executions (executions with matching ids are merged)
    plugin configuration
  7. 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>
  8. Best Practices:
    Grouping Dependencies
    Multi-module vs. Inheritance

标签: none