You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christoph Läubrich (Jira)" <ji...@apache.org> on 2023/09/18 09:16:00 UTC

[jira] [Created] (MNG-7890) Injection of PlexusConfiguration into components

Christoph Läubrich created MNG-7890:
---------------------------------------

             Summary: Injection of PlexusConfiguration into components
                 Key: MNG-7890
                 URL: https://issues.apache.org/jira/browse/MNG-7890
             Project: Maven
          Issue Type: New Feature
    Affects Versions: 4.0.0-alpha-7
            Reporter: Christoph Läubrich


One thing I found while working with components is that from time to time I want to act based on the configuration of the plugin.

At the moment one needs a quite complicated guess work or pass large parameter lists around or even worse parse configurations manually.

It would therefore be great if I could use the following in a component:


{code:java}
@Inject
@Named("my.group.id:my.plugin.id")
private PlexusConfiguration config;
{code}

that acts as a facade to the "current active configuration of that plugin":

# plugin not configured at all, no project context available or alike: simply use an empty configuration
# there is a session an it has projects but no mojos are executing: return the main configuration for that plugin and the active project
# there is a mojo execution running: return the configuration in respect to the mojo




--
This message was sent by Atlassian Jira
(v8.20.10#820010)