Fwd: Maven 3.6.3 configuration enquiry

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Maven 3.6.3 configuration enquiry

Nitish Mittal
Hi team,

We are already using maven 3.3.9 and for some projects we want to configure
3.6.3 in the same set of build agents. Can you please help me to understand
if there would be any issue if both versions co-exist on the same set of
servers. Is there any setting that needs to be done for them to co-exist.

Secondly, i see there are 2 improvement issues in release notes, can you
please halp me to know if we need to make those changes in our user
settings file? or the project settings file?

Thanks
Nitish Mittal
Reply | Threaded
Open this post in threaded view
|

Re: Maven 3.6.3 configuration enquiry

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.

When sharing the local maven cache, it usually works across different maven versions, just be careful when using it in parallel (using one cache per executor is sometimes more robust).

Gruss
Bernd


--
http://bernd.eckenfels.net
________________________________
Von: Nitish Mittal <[hidden email]>
Gesendet: Thursday, January 7, 2021 6:18:57 PM
An: [hidden email] <[hidden email]>
Betreff: Fwd: Maven 3.6.3 configuration enquiry

Hi team,

We are already using maven 3.3.9 and for some projects we want to configure
3.6.3 in the same set of build agents. Can you please help me to understand
if there would be any issue if both versions co-exist on the same set of
servers. Is there any setting that needs to be done for them to co-exist.

Secondly, i see there are 2 improvement issues in release notes, can you
please halp me to know if we need to make those changes in our user
settings file? or the project settings file?

Thanks
Nitish Mittal
Reply | Threaded
Open this post in threaded view
|

Re: Maven 3.6.3 configuration enquiry

Delany
In reply to this post by Nitish Mittal
Have you tried the Maven wrapper? https://www.baeldung.com/maven-wrapper
Delany

On Thu, 7 Jan 2021 at 20:26, Nitish Mittal <[hidden email]>
wrote:

> Hi team,
>
> We are already using maven 3.3.9 and for some projects we want to configure
> 3.6.3 in the same set of build agents. Can you please help me to understand
> if there would be any issue if both versions co-exist on the same set of
> servers. Is there any setting that needs to be done for them to co-exist.
>
> Secondly, i see there are 2 improvement issues in release notes, can you
> please halp me to know if we need to make those changes in our user
> settings file? or the project settings file?
>
> Thanks
> Nitish Mittal
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven 3.6.3 configuration enquiry

Jörg Schaible
In reply to this post by Bernd Eckenfels
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Maven 3.6.3 configuration enquiry

Bernd Eckenfels
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 <[hidden email]>
Gesendet: Thursday, January 7, 2021 10:38:45 PM
An: Maven Users List <[hidden email]>
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Maven 3.6.3 configuration enquiry

John Patrick
I use https://github.com/takari/maven-wrapper which is being adopted
and merged into maven as a core plugin as part of maven v3.7.0.

For me it allows each git commit to control what version of maven to
use, the developer and cicd for the same commit will be using the same
version of maven as they will both be building using mvnw.

Setup your maven wrapper for 3.3.9, change your cicd to use mvnw,
check it all works with 3.3.9.
Create a new branch and update maven wrapper to use 3.6.3 (simple
properties file change aka "mvn -N io.takari:maven:0.7.7:wrapper
-Dmaven=3.6.3"), commit and push, check your cicd still passes and
then merge into your develop/main branch.
Need to check or test an older commit or release, checkout that
branch/tag/commit because your using mvnw you don't need to remember
what version of maven was needed to build it as source control and
mvnw will handle it for you.

Some people have mention issues with some maven plugins when using the
maven wrapper, I've not had any issues in the 4 years I've been using
the takari maven wapper. But I don't use the maven release plugin, I
currently use https://github.com/aleksandr-m/gitflow-maven-plugin.

John

On Thu, 7 Jan 2021 at 21:51, Bernd Eckenfels <[hidden email]> wrote:

>
> 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 <[hidden email]>
> Gesendet: Thursday, January 7, 2021 10:38:45 PM
> An: Maven Users List <[hidden email]>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>

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