Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flatten-maven-plugin for consumer pom preparation #901

Closed
wants to merge 1 commit into from

Conversation

rgprajeen
Copy link

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 the clean phase. This helps in simplifying and creating a consistent POM structure for consumer projects.

Changes made:

  1. Added the Flatten Maven Plugin to the pom.xml:
    • Added the plugin version 1.6.0.
    • Configured the plugin to flatten the POM during the process-resources phase with flattenMode set to oss which retains popular tags in pom.
    • Set up the plugin's clean goal to be executed during the clean phase.
  2. Updated .gitignore:
    • Added an entry to ignore the generated .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:

  • Ensure that the build successfully flattens the POM file during the process-resources phase and the same is used when invoking mvn install locally.
  • Verify that .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.

Signed-off-by: R G Prajeen <p@prajeen.com>
@rgprajeen
Copy link
Author

@ceki @tony19 Considering the changes are really small and is intended for improvement in user's QOL. Do you mind reviewing this out?

@ceki ceki self-assigned this Jan 3, 2025
@ceki ceki added the UNCLEAR label Jan 3, 2025
@ceki
Copy link
Member

ceki commented Jan 3, 2025

@rgprajeen Thank you for this PR. Being unfamiliar with the flatten-maven-plugin and not wishing to add a layer of indirection to the build process, this PR will not be merged.

@ceki ceki closed this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants