Re: Absolute location of settings files help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Absolute location of settings files help

Falko Modler
Inject the MavenSession:

@Parameter(defaultValue ="${session}", readonly = true)
private  MavenSession mavenSession;

and then:

mavenSession.getRequest() -> getUserSettingsFile() or getGlobalSettingsFile()


Cheers,

Falko

Am 23.07.2020 um 13:42 schrieb John Patrick:

>  From within a plugin, how can I obtain the global settings and user settings???
>
> Not the effective settings object, the real location of the files
> being used, so what SettingsXmlConfigurationProcessor works out.
>
> I've worked out that either MavenExecutionRequest or
> SettingsBuildingRequest contain this information, but can't work out
> how to get access to these from within the plugin.
>
> Is there a method or interface or annotation that I can use, or do I
> need to register for the EventSpyDispatcher?
>
> I've looked in most org.apache.maven.plugins but can't find what I'm
> looking for. Google just gives me the source or javadoc of these files
> and stackoverflow gives irrelevant answers.
>
> Cheers,
> John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>