Hey Olivier,

thanks for help. Your code works for user settings.xml located in
${user.home}/.m2/settings.xml but it does not work for global settings
located in my %M2_HOME%/conf/settings.xml.
This is probably caused by the fact that I am not executing your code from
inside maven plugin. I am just running standalone java class which uses
aether.
Is there some easy solution for this? (currently, as a workaround, I do the
global setting lookup manually by using the M2_REPO environment variable)


Kind Regards,

Marek Psiuk

On Wed, Dec 21, 2011 at 10:46 PM, Olivier Lamy <[email protected]> wrote:

> are miss you
> the best is to subscribe.
>
>
> ---------- Forwarded message ----------
> From: Olivier Lamy <[email protected]>
> Date: 2011/12/21
> Subject: Re: maven-settings-builder-3.0.3 no default settings.xml
> To: Maven Users List <[email protected]>
>
>
> Something like :
>
>        SettingsBuildingRequest settingsBuildingRequest = new
> DefaultSettingsBuildingRequest();
>
>        settingsBuildingRequest.setGlobalSettingsFile(
> MavenCli.DEFAULT_GLOBAL_SETTINGS_FILE );
>        settingsBuildingRequest.setUserSettingsFile(
> MavenCli.DEFAULT_USER_SETTINGS_FILE );
>
>        settingsBuildingRequest.setUserProperties( add some properties );
>
>        return lookup( SettingsBuilder.class ).build(
> settingsBuildingRequest ).getEffectiveSettings();
>
> lookup is plexus lookup
>
> 2011/12/21 Marek Psiuk <[email protected]>:
> > Hello,
> >
> > I am working on a project which uses aether for resolving maven
> artifacts.
> > On the main aether site (https://docs.sonatype.org/display/AETHER/Home)
> they
> > suggest maven-settings-builder for resolving settings.xml.
> > However in the newest artifact version:
> >
> http://maven.apache.org/ref/3.0.3/maven-settings-builder/apidocs/org/apache/maven/settings/building/SettingsBuilder.html
> > I
> > cannot find a method which just simply resolves default settings.xml
> > without providing any parameters in SettingsBuildingRequest.
> > In the previous maven-settings:
> >
> http://maven.apache.org/ref/2.2.1/maven-settings/apidocs/org/apache/maven/settings/MavenSettingsBuilder.html
> > It
> > was simple, one just invokes parameterless buildSettings method and he
> got
> > everything.
> >
> > Am I missing sth or has the new maven-settings-builder less features than
> > version 2.2.1.
> >
> > Thanks for any help.
> >
> >
> > I am not subscribe to the list so just please CC me.
>
> To be sure about having answers do it.
>
> >
> >
> > Kind Regards,
> >
> > Marek Psiuk
> >
> > P.S.
> >
> > For now I thinking about copying code from 2.2.1 which resolves default
> > whereabouts of settings.xml and only then using
> maven-settings-builder-3.0.3
>
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
>

Reply via email to