You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jim McCaskey <ji...@pervasive.com> on 2009/04/14 18:28:18 UTC
settings.xml precedence
Hello all,
I'm having some trouble tracking down how the precedence works for settings.xml. I have a settings.xml in my ~/.m2 directory. However, when I invoke a build I pass -Dorg.apache.maven.global-settings on the command line. Should Maven not use the setting.xml specified on the command line? It seems to be using the one in the ~/.m2 directory. Is there any way to make it ignore the ~/.m2 directory version?
The CLI does not appear to be referenced in the settings reference:
http://maven.apache.org/settings.html
FWIW, I'm using Maven 2.1.
-Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: settings.xml precedence
Posted by Jim McCaskey <ji...@pervasive.com>.
Brett,
Thanks, that's exactly what I needed.
-Jim
-----Original Message-----
From: Brett Porter [mailto:brett@apache.org]
Sent: Tuesday, April 14, 2009 7:22 PM
To: Maven Users List
Subject: Re: settings.xml precedence
On 15/04/2009, at 8:15 AM, Jim McCaskey wrote:
> Brian,
>
> I'm uncertain what you are referring to. I cannot find
> documentation referring to -s. What I currently do is invoke Maven
> like this:
>
> mvn clean install -Dorg.apache.maven.global-settings=E:
> \settings_di.xml
Maven has two settings files, one in the Maven installation (under
conf/settings.xml), and one in the user's home directory. They are
merged, and the latter overrides anything in the former. It is the
first you are overriding here, so your home directory one still applies.
>
> I was under the impression that org.apache.maven.global-settings
> overrode the installed settings.xml.
That's correct, but not the one in your home directory.
> The problem is that the settings_di.xml is being overridden by the
> contents of:
>
> C:\Documents and Settings\jmccaske\.m2\settings.xml
>
> Was -s something new added in 2.1.0? How do I use that?
-s has been in Maven as long as I can remember. The -D argument you
gave above is deprecated in 2.1.0 and you should use -gs instead. Try
mvn --help, it will list the available config.
What you want is:
mvn clean install -s e:\settings_di.xml
- Brett
---------------------------------------------------------------------
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: settings.xml precedence
Posted by Brett Porter <br...@apache.org>.
On 15/04/2009, at 8:15 AM, Jim McCaskey wrote:
> Brian,
>
> I'm uncertain what you are referring to. I cannot find
> documentation referring to -s. What I currently do is invoke Maven
> like this:
>
> mvn clean install -Dorg.apache.maven.global-settings=E:
> \settings_di.xml
Maven has two settings files, one in the Maven installation (under
conf/settings.xml), and one in the user's home directory. They are
merged, and the latter overrides anything in the former. It is the
first you are overriding here, so your home directory one still applies.
>
> I was under the impression that org.apache.maven.global-settings
> overrode the installed settings.xml.
That's correct, but not the one in your home directory.
> The problem is that the settings_di.xml is being overridden by the
> contents of:
>
> C:\Documents and Settings\jmccaske\.m2\settings.xml
>
> Was -s something new added in 2.1.0? How do I use that?
-s has been in Maven as long as I can remember. The -D argument you
gave above is deprecated in 2.1.0 and you should use -gs instead. Try
mvn --help, it will list the available config.
What you want is:
mvn clean install -s e:\settings_di.xml
- Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: settings.xml precedence
Posted by Jim McCaskey <ji...@pervasive.com>.
Brian,
I'm uncertain what you are referring to. I cannot find documentation referring to -s. What I currently do is invoke Maven like this:
mvn clean install -Dorg.apache.maven.global-settings=E:\settings_di.xml
I was under the impression that org.apache.maven.global-settings overrode the installed settings.xml. The problem is that the settings_di.xml is being overridden by the contents of:
C:\Documents and Settings\jmccaske\.m2\settings.xml
Was -s something new added in 2.1.0? How do I use that?
-Jim
-----Original Message-----
From: Brian Fox [mailto:brianf@infinity.nu]
Sent: Tuesday, April 14, 2009 5:06 PM
To: Maven Users List
Subject: Re: settings.xml precedence
The -D doesn't change the settings, -s does. This most likely only
overrides the user settings file, but the global one in the maven
install /conf folder would still be referenced if it exists.
Jim McCaskey wrote:
> Hello all,
>
> I'm having some trouble tracking down how the precedence works for settings.xml. I have a settings.xml in my ~/.m2 directory. However, when I invoke a build I pass -Dorg.apache.maven.global-settings on the command line. Should Maven not use the setting.xml specified on the command line? It seems to be using the one in the ~/.m2 directory. Is there any way to make it ignore the ~/.m2 directory version?
>
> The CLI does not appear to be referenced in the settings reference:
>
> http://maven.apache.org/settings.html
>
> FWIW, I'm using Maven 2.1.
>
> -Jim
>
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: settings.xml precedence
Posted by Brian Fox <br...@infinity.nu>.
The -D doesn't change the settings, -s does. This most likely only
overrides the user settings file, but the global one in the maven
install /conf folder would still be referenced if it exists.
Jim McCaskey wrote:
> Hello all,
>
> I'm having some trouble tracking down how the precedence works for settings.xml. I have a settings.xml in my ~/.m2 directory. However, when I invoke a build I pass -Dorg.apache.maven.global-settings on the command line. Should Maven not use the setting.xml specified on the command line? It seems to be using the one in the ~/.m2 directory. Is there any way to make it ignore the ~/.m2 directory version?
>
> The CLI does not appear to be referenced in the settings reference:
>
> http://maven.apache.org/settings.html
>
> FWIW, I'm using Maven 2.1.
>
> -Jim
>
>
> ---------------------------------------------------------------------
> 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