Skip to content

Keep parent in flatten-bom configuration #37

@vy

Description

@vy

flatten-bom configuration of flatten-maven-plugin doesn't keep the parent. This causes build failures for artifacts whose dependencies need to be resolved at runtime. Consider the following problem experienced in log4j-changelog-maven-plugin:

  1. log4j-changelog-maven-plugin depends on log4j-changelog
  2. log4j-changelog inherits from log4j-tools-parent
  3. log4j-tools-parent inherits from log4j-tools-bom
  4. log4j-tools-bom inherits from logging-parent
  5. logging-parent contains dependencyManagement, etc. entries that are used by log4j-changelog-maven-plugin
  6. Dependencies of log4j-changelog-maven-plugin et al. is resolved at runtime
  7. Though at runtime, the deployed log4j-tools-bom is used, which is flattened and hence doesn't have a parent!
  8. Hence, at runtime, log4j-transform-maven-plugin execution fails due to missing logic that should have been inherited from logging-parent

To avoid this, flatten-bom configuration should better keep the parent using <parent>keep</parent> in pomElements block.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions