This (setting automatically of M2_HOME) does not work in all cases, especially 
not if the launch script is not used (IDE or Maven Agents), but it would be 
best to not set it, if not needed (agreed).


--
http://bernd.eckenfels.net
________________________________
Von: Jörg Schaible <[email protected]>
Gesendet: Thursday, January 7, 2021 10:38:45 PM
An: Maven Users List <[email protected]>
Betreff: Re: Maven 3.6.3 configuration enquiry

Am Donnerstag, 7. Januar 2021, 20:23:27 CET schrieb Bernd Eckenfels:
> You did not say what build servers you use, but normally you can have many
> different maven versions installed in different directories. Usually CI
> servers are fine to pick one (some like Jenkins can even install them
> dynamically).
>
> If you do it, you need to watch out for not using/inheriting environment
> variables (especially PATH, java and maven home), when using a user/global
> settings.xml it should be valid for all versions (it usually is) or specify
> a unique file for each environment with the -s flag. Also make sure to
> specify the full path to the mvn launcher. Some plugins like maven release
> plugin also prefer if you set the correct M2_HOME env variable.

Best is not to set it at all. Then it is automatically set by the individual
shell script that starts Maven (bin/mvn or bin/mvn.cmd) and will automatically
point to the current Maven in use.

[snip]

Cheers,
Jörg




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to