Skip to content

Add Support for Maven Profiles in Effective POM Generation #178

@erangel

Description

@erangel

Add Support for Maven Profiles in Effective POM Generation

Overview

Add capability to consider active Maven profiles when generating the effective POM for linting. This improves accuracy of linting by considering profile specific dependencies and configurations.

Problem Statement

Currently, the Mule Linter generates an effective pom by calling Maven, but does not consider active profiles. This leads to potential false positives/negatives when projects use profile specific dependencies or configurations.

Proposed Solution

  1. Obtain set of active profiles from Maven context and use them when generating effective pom
  2. Add optional CLI parameter to specify active profiles for linting

Detailed Requirements

Maven Profile Support

  • Add support to obtain active profiles from Maven context
  • Use active profile list when calling Maven for effective POM generation

CLI Enhancement

  • Add new parameter: --profiles or -p
  • Accept comma-separated list of profile IDs

Technical Implementation Notes

  • Update MuleApplication to accept a new optional constructor parameter for a profile List
  • Update getEffectivePomFile to use profile list when calling Maven DefaultInvoker()
  • Maintain backward compatibility for projects not using profiles

Additional Context

This enhancement will be particularly useful for projects that use different dependencies or configurations across environments (dev, test, prod) through Maven profiles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions