windowsmavensystem-paths

Configure maven3.1.1 and maven3.6.0 on the same PC


For some reasons I have to use two different maven versions on my windows PC. I already had the maven 3.6.0 installed, working well.

Now I want to install maven3.1.1 and running it like that, for example :

3.1.1

mvnOld clean install

3.6.0

mvn clean install

So I did add in my windows system path the bin folder of the 3.1.1 and in this same folder I did rename files to match mvnOld

enter image description here

For some reasons it's not working, when opening a new CMD, mvnOld is still an unknow command.

What did I miss? Any better ways ?

ps: In those files there was $M2_HOME used, that I did replace with $M2_OLD_HOME that points out on my 3.1.1 folder.


Solution

  • Your approach is very brittle.

    I know the problem: For building Nexus 2.x plugins, you can only use Maven 3.0.4 or Maven 3.0.5.

    I did not put the old Maven on the path but used Eclipse to solve the problem: For the Nexus plugin project, I set the old Maven.

    If you need to use command line, you can just use the full qualified name for the old Maven.