I think MavenSettingsBuilder should be what you want to load it, but we don't have anything that will persist it. It will take care of figuring out where to load it from and the hierachy.

It probably needs a method to be able to save to the one in ~/.m2/ settings.xml as well, which can be done by:

SettingsXpp3Writer w = new SettingsXpp3Writer();
w.write( settings );

(+ exception handling).

That should definitely remain isolated to the settings code though so that the location like ~/.m2 doesn't propogate out into the other modules.

HTH,
Brett

On 29/08/2006, at 8:15 AM, gredler wrote:


Hi,

I'm working on the license clickthough functionality in the artifact
resolver (http://jira.codehaus.org/browse/MNG-671), and I need to know:

 - what the best way of retrieving the current Settings object is
 - what the best way of saving changes to the Settings object is

I'm hoping that I can just add a line or two to a components.xml file and
have Maven automagically wire the object up.

I've been banging my head against MavenSettingsBuilder (recently
refactored), MavenTools, MavenEmbedder, etc. There has to be a simple way to
do this behind all the abstractions!

Thanks,

Daniel
--
View this message in context: http://www.nabble.com/how-to-get- current-settings-object-tf2180267.html#a6029320
Sent from the Maven Developers forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to