Add flatten-maven-plugin for consumer pom preparation #901
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the flatten-maven-plugin to the project for preparing the consumer POM. The plugin is configured to flatten the POM file during the
process-resources
phase and clean up during theclean
phase. This helps in simplifying and creating a consistent POM structure for consumer projects.Changes made:
pom.xml
:1.6.0
.process-resources
phase withflattenMode
set tooss
which retains popular tags in pom.clean
goal to be executed during theclean
phase..gitignore
:.flattened-pom.xml
file to avoid committing generated artifacts.Motivation:
The goal is to prepare the consumer POM by flattening its structure, removing unnecessary information, and simplifying it for downstream usage, especially in the context of distributing and using the POM as a dependency in other projects. With the addition of this plugin during the build process (and the deployment process), the dependencies with version property are resolved and hardcoded. Also, the child-parent module versioning is hardcoded to prevent any kind of ambiguity for the users.
Testing:
process-resources
phase and the same is used when invokingmvn install
locally..flattened-pom.xml
is not tracked in version control.Additional Information:
No new features or bug fixes were introduced, only a configuration to simplify the POM file for easier consumption in other projects.