Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

(3) UserProperty (command line values) policy: scan list for URIs that map to user property values.
(4) Environmental policy: scan list for values containing  ${env.*} and replacing them
(5) Model Property policy: scan list for any remaining values containing ${project.*} and replacing them
(6) Illegal values policies: scan list for any illegal values (self-referential)
(7) System property policy

Rules

 There are three primary types of rules, processed in the following order 

1) Project Model Specific Rules - rules that are specific to the pom that are not collection specific, such as constructing of SCM URL, not inheriting packaging, etc

2) General Sorting - sorting rules done during the initial collapse of the XML hierarchy

3) ModelContainer Rules - rules specific to the pom that are done per collection, plugins, resources, etc, These rules have three possible actions: Delete, join or no op.

Project Model Specific Rules
  1. Scm URL (scmURL, scmDeveloperConnection, scmConnection)
    Say most specialized model is M0. Take first occurrence of scm URL from most specialized model, call this model M1. If M0=M1, then scmURL(M0) is used unaltered. If M1 > M0, then scmURL=scmURL(M1) + ArtifactID(M0). This rule is recursive.
  2. Modules are not inherited
  3. If group ID does not exist in pom, use parent group ID if it exists. Otherwise, fail.
  4. If version does not exist in pom, use parent version if it exists. Otherwise, fail.
  5. If plugin execution 'inherited' value is false, do not inherit the plugin execution
  6. If plugin inherited tag is false, do not inherit the plugin
  7. Dependencies must be ordered with the most specialized pom's dependencies appearing first.
  8. project/name property is not inherited
  9. packaging property is not inherited
  10. build/resources node is not inherited
  11. build/TestResources node is not inherited
  12. Profiles node is not inherited
  13. Dependencies with the same groupId, artifactId and version are not joined if they have different types.
  14. Plugin Repositories are not inherited

All exception rules are processed, on a per project model basis, before general sorting and ModelContainer rules (joining and deleting).

General Sorting Rules:

(1) If it is a singleton URI (one per model) with a value, then the most specialized model value will be used.

...

Code Block
borderStylesolid
titleCollections (Pom)
http://apache.org/maven/project/build/resources#collection
http://apache.org/maven/project/build/testResources#collection
http://apache.org/maven/project/build/extensions#collection
http://apache.org/maven/project/build/plugins#collection
http://apache.org/maven/project/build/plugins/plugin/dependencies#collection
http://apache.org/maven/project/build/plugins/plugin/dependencies/dependency/exclusions#collection
http://apache.org/maven/project/build/plugins/plugin/executions#collection
http://apache.org/maven/project/build/pluginManagement/plugins#collection
http://apache.org/maven/project/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions#collection
http://apache.org/maven/project/build/pluginManagement/plugins/plugin/executions#collection
http://apache.org/maven/project/build/pluginManagement/plugins/plugin/dependencies#collection
http://apache.org/maven/project/dependencyManagement/dependencies#collection
http://apache.org/maven/project/dependencyManagement/dependencies/dependency/exclusions#collection
http://apache.org/maven/project/dependencies/dependency/exclusions#collection
http://apache.org/maven/project/dependencies#collection
http://apache.org/maven/project/pluginRepositories#collection
http://apache.org/maven/project/repositories#collection
http://apache.org/maven/project/licenses#collection
http://apache.org/maven/project/reporting/plugins#collection
http://apache.org/maven/project/reporting/plugins/plugin/reportSets#collection
http://apache.org/maven/project/contributors#collection
http://apache.org/maven/project/developers#collection
http://apache.org/maven/project/mailingLists#collection
http://apache.org/maven/project/ciManagement/notifiers#collection
http://apache.org/maven/project/profiles#collection
http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins#collection
http://apache.org/maven/project/profiles/profile/build/plugins/plugin/dependencies/dependency/exclusions#collection
http://apache.org/maven/project/profiles/profile/reporting/plugins#collection
http://apache.org/maven/project/profiles/profile/build/testResources#collection
http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins/plugin/dependencies#collection
http://apache.org/maven/project/profiles/profile/build/resources#collection
http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions#collection
http://apache.org/maven/project/profiles/profile/build/plugins/plugin/dependencies#collection
http://apache.org/maven/project/profiles/profile/pluginRepositories#collection
http://apache.org/maven/project/profiles/profile/build/pluginManagement/plugins/plugin/executions#collection
http://apache.org/maven/project/profiles/profile/dependencies#collection
http://apache.org/maven/project/profiles/profile/dependencyManagement/dependencies#collection
http://apache.org/maven/project/profiles/profile/repositories#collection
http://apache.org/maven/project/profiles/profile/reporting/plugins/plugin/reportSets#collection
http://apache.org/maven/project/profiles/profile/build/plugins#collection
http://apache.org/maven/project/profiles/profile/build/plugins/plugin/executions#collection
http://apache.org/maven/project/profiles/profile/dependencies/dependency/exclusions#collection
http://apache.org/maven/project/profiles/profile/dependencyManagement/dependencies/dependency/exclusions#collection
Exception Rules
  1. Scm URL (scmURL, scmDeveloperConnection, scmConnection)
    Say most specialized model is M0. Take first occurrence of scm URL from most specialized model, call this model M1. If M0=M1, then scmURL(M0) is used unaltered. If M1 > M0, then scmURL=scmURL(M1) + ArtifactID(M0). This rule is recursive.
  2. Modules are not inherited
  3. If group ID does not exist in pom, use parent group ID if it exists. Otherwise, fail.
  4. If version does not exist in pom, use parent version if it exists. Otherwise, fail.
  5. If plugin execution 'inherited' value is false, do not inherit the plugin
  6. Dependencies must be ordered with the most specialized pom's dependencies appearing first.
  7. project/name property is not inherited
  8. packaging property is not inherited
  9. build/resources node is not inherited
  10. build/TestResources node is not inherited
  11. Profiles node is not inherited
  12. Dependencies with the same groupId, artifactId and version are not joined if they have different types.
Misc Rules

1. All models inherit from the super pom.

Rules in Question

1. Remove PluginRepositories node: in 2.0.x this node is inherited, in 2.1.x it is not.

Changes between 2.0.x and 2.1
  1. Default group id in pom is no longer supported
  2. SCM URL no longer uses module value but rather the artifact id.
Model Container Rules

Processing order: 

  1. If a profile is active, the elements will be placed with precendence within the model property list. For example, if the profile contains an artifact with a different version than in the pom.dependencies.dependency, the artifact version within the profile will override the one within the primary pom. In short, this means that profile information is the most specialized model within the inheritence chain. Also the profiles will also be inherited from parent poms (and possibly joined). 
  2. For (A), (C-F), : values will be joined and deleted, with the most specialized model taking precedence. Any subcontainers like Plugin.Executions will also be joined based on equivalent ids.
  3. PluginManagement: Any PluginContainer that does not contain a version, will be joined with the PluginManagementContainer that contains the same artifactId and groupId. Any dependencies within the PluginContainer will also be joined or deleted according to the DependencyContainer.
  4. DependencyManagement: Any DependencyContainer that does not contain a version, will be joined with the DependencyManagementContainer that contains the same artifactId and groupId. 
  5. Interpolation of values 


Each collection in the model may need a ModelContainer implementation. The following rules apply:

  1. project/build/resources#collection
    No joins, just add additional resource tags. No container needed.
  2. project/build/testResources#collection
    No joins, just add additional testResource tags. No container needed.
  3. project/build/plugins#collection
    If groupId, artifactId and version are equals then join. If only groupId, artifactId are the same, but version is different, delete last container.
  4. project/build/plugins/plugin/dependencies#collection
    If groupId, artifactId and version are equals then join. If only groupId, artifactId are the same, but version is different, delete last container.
  5. project/build/plugins/plugin/dependencies/dependency/exclusions#collection
    No joins, just add additional exclusion tags. No container needed.
  6. project/build/plugins/plugin/executions#collection
    Joined if ids are the same, otherwise additional execution tag is added.
  7. project/build/extensions#collection
    No joins, add extension provided any of artifactId, groupId and version are different.
  8. project/build/pluginManagement/plugins#collection
    If groupId, artifactId and version are equals then join. If only groupId, artifactId are the same, but version is different, delete last container.
  9. project/build/pluginManagement/plugins/plugin/dependencies/dependency/exclusions#collection
    No joins, just add additional exclusion tags. No container needed.
  10. project/build/pluginManagement/plugins/plugin/executions#collection
    Joined if ids are the same, otherwise additional execution tag is added.
  11. project/build/pluginManagement/plugins/plugin/dependencies#collection
    If groupId, artifactId and version are equals then join. If only groupId, artifactId are the same, but version is different, delete last container.
  12. project/dependencyManagement/dependencies#collection
    If groupId, artifactId and version are equals then join. If only groupId, artifactId are the same, but version is different, delete last container.
  13. dependencyManagement/dependencies/dependency/exclusions#collection
    No joins, just add additional exclusion tags. No container needed
  14. project/dependencies/dependency/exclusions#collection
    No joins, just add additional exclusion tags. No container needed
  15. project/dependencies#collection
    If groupId, artifactId and version are equals then join. If only groupId, artifactId are the same, but version is different, delete last container.
  16. project/pluginRepositories#collection
    Joined if ids are the same, otherwise additional pluginRepository tag is added.
  17. project/repositories#collection
    Joined if ids are the same, otherwise additional repository tag is added.
  18. project/licenses#collection
    No joins, just add additional license tags. No container needed
  19. project/reporting/plugins#collection
    If groupId, artifactId and version are equals then join. If only groupId, artifactId are the same, but version is different, delete last container.
  20. project/reporting/plugins/plugin/reportSets#collection
    Joined if ids are the same, otherwise additional reportSet tag is added.
  21. project/contributors#collection
    No joins, just add additional contributor tags. No container needed
  22. project/developers#collection
    No joins, just add additional developer tags. No container needed
  23. project/mailingLists#collection
    No joins, just add additional mailingList tags. No container needed
  24. project/ciManagement/notifiers#collection
    No joins, just add additional notifier tags. No container needed
  25. project/profiles#collection
    Joined if ids are the same, otherwise additional profile tag is added.

There is also a concept of an XML defined collection that can be used to define collections within the configuration sections of the pom. This can be done by adding the property combine.children="append" to an XML element. The framework will then merge the XML elements of parent and child.

All other profile collections/containers are processed according to their respective rules above.

Misc Rules

1. All models inherit from the super pom.

Rules in Question

1. Remove PluginRepositories node: in 2.0.x this node is inherited, in 2.1.x it is not.

Changes between 2.0.x and 2.1
  1. Default group id in pom is no longer supported
  2. SCM URL no longer uses module value but rather the artifact id.
Transforming Between Models

Transforming between XML based models involves changing the URIs. For example to change between the canonical model (which is based on the pom) and a C# project file, you would rename the URIs.

...