Skip to content

v4 API: Mojo configuration introspection without execution #13518

Open

Description

@gnodet

Parent: #13499 | Related: #13465

Problem

There is no v4 API for reading a mojo's resolved parameter values without executing it.
Today this requires internal APIs: MavenPluginManager.getConfiguredMojo() / releaseMojo(),
PluginParameterExpressionEvaluator, ConfigurationConverter, and manual
SessionScope/MojoExecutionScope enter/seed/exit management.

Who needs this

  • m2e: Project configurators read plugin parameters to configure IDE projects.
    AbstractJavaProjectConfigurator reads ~30 parameters from maven-compiler-plugin
    (source, target, release, encoding, compilerArgs, compileSourceRoots, etc.)
    to configure Eclipse JDT. Two mechanisms are used:
    • getMojoParameterValue() — resolves individual parameters with expression
      evaluation
    • getConfiguredMojo() — fully instantiates the mojo object so any field can be
      read (used for complex typed configuration like surefire's argLine, archive config)

What's needed

A v4 API for mojo configuration introspection:

  • Resolve and return parameter values for a given MojoExecution without side effects
  • Support expression evaluation (${project.basedir}, ${settings.localRepository}, etc.)
  • Support type conversion (string → Path, List, complex objects)
  • Ideally both single-parameter lookup and full mojo instantiation (for complex configs)

This is unique to IDE embedders — CLI builds never need to read parameters without
executing.

🤖 Drafted with Claude Code (Claude Opus 4.6, interactive mode). Reviewed and confirmed by @gnodet before submission.

Activity

  1. added
    enhancement
    on Oct 14, 2026
  2. abdulhannansyed548-cmd commented on Oct 28, 2026

    @abdulhannansyed548-cmd
    Contributor

    @gnodet Hello,

    I’d like to contribute to this issue and wanted to ask for your thoughts before getting started.

    From what I’ve explored so far, MojoExecution.configuration() provides the merged XML configuration. Would the idea be to add a public Maven 4 API that allows accessing resolved Mojo parameter values without executing the Mojo?

    I also had a small question about the design: would it make more sense to retrieve parameters individually or provide access to all resolved parameters?

    I’d be happy to look into this further and work on a solution based on your suggestions.

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions