You could do even better!

in X create mvn.bat that is just

    @echo off
    %MAVEN_HOME%\bin\mvn.bat -s %USERPROFILE%\.m2\settings-x.xml %*

create mvn.sh that is just

    #!/bin/sh
    $MAVEN_HOME/bin/mvn -s ~/.m2/settings-x.xml $*


in Y create mvn.bat that is just

    @echo off
    %MAVEN_HOME%\bin\mvn.bat -s %USERPROFILE%\.m2\settings-y.xml %*

create mvn.sh that is just

    #!/bin/sh
    $MAVEN_HOME/bin/mvn -s ~/.m2/settings-y.xml $*

Now whichever window you are in, running mvn or ./mvn.sh will use the
correct settings.xml and will not require remembering which command to
launch from which window.

You can even check these batch and shell scripts into SCM so that the
release plugin will not complain about them.

-Stephen

P.S.

  you could make them even more portable by having them check for the
settings-x.xml and settings-y.xml and reverting to defaults if those
settings are not present

On Thu, Mar 20, 2008 at 7:47 AM, Wayne Fay <[EMAIL PROTECTED]> wrote:

> You could do the following...
>
> Copy ~/.m2/settings.xml to ~/.m2/settingsy.xml
> Configure localRepository in settingsy.xml to point "somewhere else"
>
> Copy MAVEN_HOME/bin/mvn.bat to mvny.bat
> Edit mvny.bat and append "-f ~/.m2/settingsy.xml" to the call to mvn
>
> Then call normal "mvn" from X, and mvny from Y. This will
> automatically use the 2 localRepositories without messing with poms or
> logging in as 2 users etc. You just have to remember to use mvn in one
> window and mvny in the other.
>
> Wayne
>
> On 3/19/08, Dan Fabulich <[EMAIL PROTECTED]> wrote:
> > Brian E. Fox wrote:
> >
> > >> Samuel Le Berrigaud wrote:
> > >>
> > >>> 1. only run mvn verify, this way nothing gets installed into the
> local
> > >>> repository,
> > >>
> > >> This doesn't work in a multi-module reactor build where the modules
> > >> depend on each other, does it?
> >
> > > No, it will only work if you at least do compile (then a reference to
> > > /target/classes is passed instead of the jar)
> >
> > Huh?  verify is after compile, right before install.  (Actually, I did
> > "package", then later tried "verify" to see if it would work; neither
> > did.)  Should that have worked?
> >
> > -Dan
> >
> > ---------------------------------------------------------------------
> > 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