You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Baz <ba...@gmail.com> on 2007/07/31 21:19:35 UTC

setting default location of settings.xml

Hi,

Is there a way to setup default location of settings.xml? I understand the
default location is M2 repo.

I am trying to have settings.xml stored in Perforce and add an environment
variable to point to a directory so developers can have a consistent
settings.xml file. Suggestion?

Thanks.

A.

Re: setting default location of settings.xml

Posted by Baz <ba...@gmail.com>.
Wayne,

Thanks for your reply. I forgot to say that I also checked the "-s" flag.

So, there is no environment variable to indicate the path or
exact_path/file_name right?

It is possible to edit mvn.bat but i want to make sure it is possible for
developers to use their personal copy also. I am sure there are many ways to
do it but i am not sure which one is the best.


On 7/31/07, Wayne Fay <wa...@gmail.com> wrote:
>
> Looks like you want to use "mvn -s <your location here>".
>
> C:\cvs_root\xsltc-maven-plugin>mvn -h
> usage: mvn [options] [<goal(s)>] [<phase(s)>]
> Options:
> -s,--settings                 Alternate path for the user settings file
>
> To make this work consistently, you could probably edit the mvn.bat
> file itself to provide the -s setting automatically with every
> execution of mvn.
>
> Also, refer to this webpage for more info on settings.xml files:
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
>
> Wayne
>
> On 7/31/07, Baz <ba...@gmail.com> wrote:
> > Hi,
> >
> > Is there a way to setup default location of settings.xml? I understand
> the
> > default location is M2 repo.
> >
> > I am trying to have settings.xml stored in Perforce and add an
> environment
> > variable to point to a directory so developers can have a consistent
> > settings.xml file. Suggestion?
> >
> > Thanks.
> >
> > A.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: setting default location of settings.xml

Posted by Wayne Fay <wa...@gmail.com>.
Looks like you want to use "mvn -s <your location here>".

C:\cvs_root\xsltc-maven-plugin>mvn -h
usage: mvn [options] [<goal(s)>] [<phase(s)>]
Options:
 -s,--settings                 Alternate path for the user settings file

To make this work consistently, you could probably edit the mvn.bat
file itself to provide the -s setting automatically with every
execution of mvn.

Also, refer to this webpage for more info on settings.xml files:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Wayne

On 7/31/07, Baz <ba...@gmail.com> wrote:
> Hi,
>
> Is there a way to setup default location of settings.xml? I understand the
> default location is M2 repo.
>
> I am trying to have settings.xml stored in Perforce and add an environment
> variable to point to a directory so developers can have a consistent
> settings.xml file. Suggestion?
>
> Thanks.
>
> A.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: setting default location of settings.xml

Posted by Wayne Fay <wa...@gmail.com>.
Sounds reasonable to me, and should be easy enough to test that it
works etc before committing everyone to it, only to discover a
problem, etc.

Wayne

On 7/31/07, Baz <ba...@gmail.com> wrote:
> Dana, Wayne,
>
> What about this?
>
> 1. Change mvn.bat to do "-s $MVN_SETTING_FILE".
> 2. Define MVN_SETTING_FILE in the shell environment.
> 3. Point the MVN_SETTING_FILE to the default workspace location where your
> SCM tool will update the latest settings.xml (or any name in this case)
>
> This way, you can use default and customize if you want by changing the
> environment variable. This seems like a flexible solution. Comments?
>
>
>
> On 7/31/07, Lacoste, Dana <da...@hp.com> wrote:
> >
> > We checked into our project home a "settings.xml.sample" so that users
> > could customize their own environment.
> >
> > But if you added the "-s" flag to your maven command in cruise control
> > you could force it to use the checked in/perforce version at build time
> > (then just get the developers to use the shared one as well)
> >
> > Dana
> >
> > -----Original Message-----
> > From: Baz [mailto:baztheman@gmail.com]
> > Sent: Tuesday, July 31, 2007 12:20 PM
> > To: Maven Users List
> > Subject: setting default location of settings.xml
> >
> > Hi,
> >
> > Is there a way to setup default location of settings.xml? I understand
> > the default location is M2 repo.
> >
> > I am trying to have settings.xml stored in Perforce and add an
> > environment variable to point to a directory so developers can have a
> > consistent settings.xml file. Suggestion?
> >
> > Thanks.
> >
> > A.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: setting default location of settings.xml

Posted by Baz <ba...@gmail.com>.
Dana, Wayne,

What about this?

1. Change mvn.bat to do "-s $MVN_SETTING_FILE".
2. Define MVN_SETTING_FILE in the shell environment.
3. Point the MVN_SETTING_FILE to the default workspace location where your
SCM tool will update the latest settings.xml (or any name in this case)

This way, you can use default and customize if you want by changing the
environment variable. This seems like a flexible solution. Comments?



On 7/31/07, Lacoste, Dana <da...@hp.com> wrote:
>
> We checked into our project home a "settings.xml.sample" so that users
> could customize their own environment.
>
> But if you added the "-s" flag to your maven command in cruise control
> you could force it to use the checked in/perforce version at build time
> (then just get the developers to use the shared one as well)
>
> Dana
>
> -----Original Message-----
> From: Baz [mailto:baztheman@gmail.com]
> Sent: Tuesday, July 31, 2007 12:20 PM
> To: Maven Users List
> Subject: setting default location of settings.xml
>
> Hi,
>
> Is there a way to setup default location of settings.xml? I understand
> the default location is M2 repo.
>
> I am trying to have settings.xml stored in Perforce and add an
> environment variable to point to a directory so developers can have a
> consistent settings.xml file. Suggestion?
>
> Thanks.
>
> A.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: setting default location of settings.xml

Posted by "Lacoste, Dana" <da...@hp.com>.
We checked into our project home a "settings.xml.sample" so that users
could customize their own environment.

But if you added the "-s" flag to your maven command in cruise control
you could force it to use the checked in/perforce version at build time
(then just get the developers to use the shared one as well)

Dana 

-----Original Message-----
From: Baz [mailto:baztheman@gmail.com] 
Sent: Tuesday, July 31, 2007 12:20 PM
To: Maven Users List
Subject: setting default location of settings.xml

Hi,

Is there a way to setup default location of settings.xml? I understand
the default location is M2 repo.

I am trying to have settings.xml stored in Perforce and add an
environment variable to point to a directory so developers can have a
consistent settings.xml file. Suggestion?

Thanks.

A.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org