[ 
https://jira.codehaus.org/browse/MNG-5533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=336699#comment-336699
 ] 

Jörg Schaible commented on MNG-5533:
------------------------------------

And why do you set those environment variables at all? This is also done in the 
Maven start script itself, so anything is properly set if you call Maven via 
path:

 /opt/maven-3.1.1/bin/mvn
 /opt/maven-2.2.1/bin/mvn

resp.

 c:\\program files\\maven-3.1.1\\bin\\mvn.bat
 c:\\program files\\maven-2.2.1\\bin\\mvn.bat

Now you just need to add some simple links in Unix:

 /usr/bin/mvn-3.1 ==> /opt/maven-3.1.1/bin/mvn

or one line start scripts somewhere in your PATH:

 c:\\Windows\\mvn-3.1.bat:

 c:\\program files\\maven-3.1.1\\bin\\mvn.bat %*

Now you can use "mvn-3.1" at any time to call Maven 3.1.1 and "mvn-2.1" for 
Maven 2.2.1 and it is scalable for any version you like to support on your 
system. You might even add an additional "mvn" link (resp. batch file) for your 
default version.
                
> M2 vs M3
> --------
>
>                 Key: MNG-5533
>                 URL: https://jira.codehaus.org/browse/MNG-5533
>             Project: Maven 2 & 3
>          Issue Type: Improvement
>          Components: Class Loading, Command Line, Documentation:  General, 
> General
>    Affects Versions: Issues to be reviewed for 3.x
>         Environment: Windows
>            Reporter: Martin Spamer
>            Priority: Critical
>
> Maven 3 uses the M2 environment variable. Surely it would be more reasonable 
> to update this to M3 to allow sensible migration.  e.g
> M2=C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\bin
> M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-2.2.1
> M3=C:\Program Files\Apache Software Foundation\apache-maven-3.1.1\bin
> M3_HOME=C:\Program Files\Apache Software Foundation\apache-maven-3.1.1
> MAVEN=%M2%  or MAVEN=%M3%
> PATH=%MAVEN%;%PATH%

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to