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

New feature custom plugin configuration #1580

Closed

Conversation

yuehcw
Copy link
Contributor

@yuehcw yuehcw commented Jun 11, 2024

Introduction
This PR introduces the "Custom Plugin Configuration Profiles" feature, which enhances the flexibility and maintainability of plugin management in Maven projects. By enabling users to define multiple configurations for a single plugin within the POM file, this feature caters to different environments or use cases without duplicating the entire POM file.

Motivation
Current Maven configurations apply globally and statically to projects, lacking the flexibility needed for different build environments or specific use cases. This limitation makes it cumbersome to manage builds that require different configurations for the same project.

Changes Proposed

  • Profiles Section: Addition of a new section in the POM file for defining custom plugin configurations.
  • Profile Activation: Implementation of a mechanism to activate profiles based on conditions such as environment variables or system properties. This allows for dynamic configuration changes at build time without altering the POM structure for different scenarios.

Detailed Design

  1. POM File Changes: Introduce a section within the POM file. Each profile will have a unique ID and specified activation conditions.
  2. Activation Mechanism: Users can activate a profile using the Maven command line, for example: mvn clean install -Denv=dev.

Benefits

  • Flexibility: Enables tailored plugin configurations for different environments directly within the POM file.
  • Maintainability: Reduces complexity and enhances clarity by isolating environment-specific configurations.
  • Backward Compatibility: Ensures existing projects remain unaffected. Profiles are optional and only processed if defined.

Compatibility
This feature is designed to be backward compatible. Existing projects without defined profiles will operate as usual without any modification to their current behavior.

@rmannibucau
Copy link
Contributor

Hi, I'm not sure I link the description to the code:

  • code enables profiles as -P today but introducing yet another flag and tests are unrelated to that feature 🤔
  • you can already have multiple plugin configurations either with profiles/properties or with executions if you need it in the same build

Can you provide a test showing the behavior you want please?

@gnodet
Copy link
Contributor

gnodet commented Aug 26, 2024

I really don't understand this PR.
Profiles are already defined in the POM, and can already be activated using user properties...
Closing this PR.
@yuehcw please reopen if you want to provide more information

@gnodet gnodet closed this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants