You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steven Yamanaka <sy...@irise.com> on 2010/11/11 22:02:12 UTC

Maven 3 support for org.apache.maven.user-settings

In Maven 2, we could point to another location for the user settings using

    MAVEN_OPTS=-Dorg.apache.maven.user-settings=<path to settings.xml>

This doesn't appear to work in Maven 3. Is there an alternative other than the command
line option --settings?

Thanks,
Steven

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


Re: Maven 3 support for org.apache.maven.user-settings

Posted by Steven Yamanaka <sy...@irise.com>.
We override the default location for settings.xml on our build server.
Instead of placing the settings.xml and repository in the service account's
home, we keep it with the rest of our build configuration. It's not a big
change for us. I just wanted to make sure we weren't missing anything.
-- 
View this message in context: http://maven.40175.n5.nabble.com/Maven-3-support-for-org-apache-maven-user-settings-tp3261146p3266319.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven 3 support for org.apache.maven.user-settings

Posted by Stephen Connolly <st...@gmail.com>.
I use the following bash function for selecting different maven versions:

usemvn ()
{
    if [ -z "$1" -o ! -x "/opt/apache/apache-maven-$1/bin/mvn" ]; then
        echo -n "Syntax: usemvn";
        for i in /opt/apache/apache-maven-*;
        do
            if [ -x "$i/bin/mvn" ]; then
                echo -n " $(basename $i | sed 's/^apache-maven-//') |";
            fi;
        done;
        echo -e "\b ";
    else
        if [ -z "$MAVEN_HOME" ]; then
            export PATH=/opt/apache/apache-maven-$1/bin:$PATH;
        else
            export PATH=$(echo $PATH|sed -e
"s:$MAVEN_HOME/bin:/opt/apache/apache-maven-$1/bin:g");
        fi;
        export MAVEN_HOME=/opt/apache/apache-maven-$1;
    fi
}

It makes switching maven versions a lot easier. I use similar scripts
for java, ant and all the toolchains I use.

I don't know if that helps you at all though!

On 10 February 2011 10:39, Marc Rohlfs <po...@googlemail.com> wrote:
>
>
> On 09/02/11 16:16, Wayne Fay wrote:
>>>
>>> started working with an alias:
>>> >      alias mvn='mvn -s .../settings.xml'
>>> >  But this wouldn't work on Windows machines ...
>>
>> I've done something similar with "mvnclienta" and "mvnclientb". You
>> simply copy the mvn.bat file, rename it, and insert the "-s
>> .../settings-clienta.xml" into the call to mvn directly. This seems
>> like a reasonable approach to me on any OS.
>
> I'm starting the terminal with some additional, client-specific environment
> variables. This allows me to use different Maven, Java, etc. versions,
> depending on each client's specifications.
>
> With Your approach, I see 2 problems:
>
> 1. I wouldn't like to create new mvnclient* scripts on every version
> upgrade. And when I simply copy them from another Maven version, I'd first
> have to check if there aren't any changes in the original scripts.
>
> 2. Hudson offers automatic installation of Maven distributions. This is a
> very nice feature, because (especially in bigger organisations) admins often
> don't like to provide developers with access to the server hosts. But don't
> see a (reasonable) way the replicate the mvnclient* scripts in an
> automatically installed distribution.
>
> Marc
>
> ---------------------------------------------------------------------
> 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: Maven 3 support for org.apache.maven.user-settings

Posted by Marc Rohlfs <po...@googlemail.com>.

On 09/02/11 16:16, Wayne Fay wrote:
>> started working with an alias:
>> >      alias mvn='mvn -s .../settings.xml'
>> >  But this wouldn't work on Windows machines ...
> I've done something similar with "mvnclienta" and "mvnclientb". You
> simply copy the mvn.bat file, rename it, and insert the "-s
> .../settings-clienta.xml" into the call to mvn directly. This seems
> like a reasonable approach to me on any OS.

I'm starting the terminal with some additional, client-specific 
environment variables. This allows me to use different Maven, Java, etc. 
versions, depending on each client's specifications.

With Your approach, I see 2 problems:

1. I wouldn't like to create new mvnclient* scripts on every version 
upgrade. And when I simply copy them from another Maven version, I'd 
first have to check if there aren't any changes in the original scripts.

2. Hudson offers automatic installation of Maven distributions. This is 
a very nice feature, because (especially in bigger organisations) admins 
often don't like to provide developers with access to the server hosts. 
But don't see a (reasonable) way the replicate the mvnclient* scripts in 
an automatically installed distribution.

Marc

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


Re: Maven 3 support for org.apache.maven.user-settings

Posted by Wayne Fay <wa...@gmail.com>.
> started working with an alias:
>    alias mvn='mvn -s .../settings.xml'
> But this wouldn't work on Windows machines ...

I've done something similar with "mvnclienta" and "mvnclientb". You
simply copy the mvn.bat file, rename it, and insert the "-s
.../settings-clienta.xml" into the call to mvn directly. This seems
like a reasonable approach to me on any OS.

Wayne

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


Re: Maven 3 support for org.apache.maven.user-settings

Posted by Marc Rohlfs <po...@googlemail.com>.
Hi there,

the command line argument works (for me). But in Hudson (V 1.394), You 
need to add the '-s .../settings.xml' arguments to each project's build 
configuration. A global settings configuration for all Maven builds 
could only be set using the 'MAVEN_OPTS' with the 
'org.apache.maven.user-settings' (or 'org.apache.maven.global-settings') 
property.
In Hudson's project build configuration there's another field called 
'Alternate settings file'. Help item says that it's equivalent to using 
the '-s' option, but it doesn't seem to work with Maven 3 - guess that 
configuration feature is also implemented using 'MAVEN_OPTS'. (OK, this 
might be worth filing a bug report in the Hudson Jira)

Personally, I also used to use the 'MAVEN_OPTS' on my development 
environment, too. Doing development consultancy for different customers, 
I prefer to have separate Maven settings for each customer workspace, 
and it would really be annoying having to add the '-s' option (with 
maybe a long file path argument) to each and every command line statement.
After noticing that I can't set them any more using the 'MAVEN_OPTS', I 
started working with an alias:
     alias mvn='mvn -s .../settings.xml'
But this wouldn't work on Windows machines ...

All in all I'd prefer if the support for both of the system properties,
'org.apache.maven.user-settings' and 'org.apache.maven.global-settings' 
could be restored, because it would provide much more flexibility to all 
imaginable build environment setup variants.

Kind regards

    Marc


On 08/02/11 21:50, Vincent Latombe wrote:
> Use -s command-line argument?
>
> Vincent
>
>
> 2011/2/8 radai<ra...@gmail.com>
>
>>
>>
>> Benjamin Bentmann wrote:
>>>
>>> There is no alternative but support for the system property can be
>>> restored if there's a valid use case for it.
>>>
>>> Benjamin
>>>
>>
>> we have a hudson CI server running builds for multiple (maven) projects,
>> each with its own repositories. it would be nice to seperate the
>> settings.xml between builds, and not lump them all together - for that i'd
>> need to override the location of the settings file.
>>
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/Maven-3-support-for-org-apache-maven-user-settings-tp3261146p3375624.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> 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: Maven 3 support for org.apache.maven.user-settings

Posted by Vincent Latombe <vi...@gmail.com>.
Use -s command-line argument?

Vincent


2011/2/8 radai <ra...@gmail.com>

>
>
> Benjamin Bentmann wrote:
> >
> > There is no alternative but support for the system property can be
> > restored if there's a valid use case for it.
> >
> > Benjamin
> >
>
> we have a hudson CI server running builds for multiple (maven) projects,
> each with its own repositories. it would be nice to seperate the
> settings.xml between builds, and not lump them all together - for that i'd
> need to override the location of the settings file.
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Maven-3-support-for-org-apache-maven-user-settings-tp3261146p3375624.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven 3 support for org.apache.maven.user-settings

Posted by radai <ra...@gmail.com>.

Benjamin Bentmann wrote:
> 
> There is no alternative but support for the system property can be 
> restored if there's a valid use case for it.
> 
> Benjamin
> 

we have a hudson CI server running builds for multiple (maven) projects,
each with its own repositories. it would be nice to seperate the
settings.xml between builds, and not lump them all together - for that i'd
need to override the location of the settings file.

-- 
View this message in context: http://maven.40175.n5.nabble.com/Maven-3-support-for-org-apache-maven-user-settings-tp3261146p3375624.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven 3 support for org.apache.maven.user-settings

Posted by Benjamin Bentmann <be...@udo.edu>.
Steven Yamanaka wrote:

>      MAVEN_OPTS=-Dorg.apache.maven.user-settings=<path to settings.xml>
>
> This doesn't appear to work in Maven 3. Is there an alternative other than the command
> line option --settings?

There is no alternative but support for the system property can be 
restored if there's a valid use case for it.


Benjamin

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