Thanks,

I looked at the Maven Release Plugin and I see that the logic of where
Maven is installed is not in the Maven-Invoker, but in the release plugin
[1]. There is some logic on how to 'find' Maven, using environment
variables like 'maven.home', 'MAVEN_HOME' and 'M2_HOME'. Does this mean
that the choice of which setting is used and in which order is still the
responsibility of the calling plugin? Or is there some standard for that?

[1]
https://github.com/apache/maven-release/blob/dbdf3a4a8cb8db51fa73963912555be4f39a89b8/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/InvokerMavenExecutor.java#L318

With regards,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Mon, Nov 2, 2020 at 12:27 PM Thomas Broyer <t.bro...@gmail.com> wrote:

> Maybe have a look at Maven Invoker:
> https://maven.apache.org/shared/maven-invoker/
> (it's what the Maven Invoker Plugin and Maven Release Plugin use)
>
> On Mon, Nov 2, 2020 at 11:28 AM Nick Stolwijk <nick.stolw...@gmail.com>
> wrote:
>
> > Hi folks,
> >
> > We are struggling with our buildserver (Jenkins) and the Git-Flow Maven
> > Plugin[1] with regards to execute the Maven executable to run specific
> > goals and phases during release (i.e. run versions plugin to change
> version
> > or run `mvn verify` to check project).
> >
> > The gitflow-m-p uses a flag to set the executable which needs to know if
> it
> > is on Linux (run mvn) or Windows (run mvn.cmd).
> >
> > I was wondering what is the 'right' way to execute Maven from a plugin.
> > I've taken a look at the Maven Release Plugin and that one uses an
> internal
> > Executor framework. I have thought about Toolchain, but I didn't find an
> > example of a toolchain with Maven itself.
> >
> > Can anyone enlighten me?
> >
> > [1] https://github.com/aleksandr-m/gitflow-maven-plugin
> >
> > With regards,
> >
> > Nick Stolwijk
> >
> > ~~~ Try to leave this world a little better than you found it and, when
> > your turn comes to die, you can die happy in feeling that at any rate you
> > have not wasted your time but have done your best ~~~
> >
> > Lord Baden-Powell
> >
>
>
> --
> Thomas Broyer
> /tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/> <
> http://xn--nna.ma.xn--bwa-xxb.je/>
>

Reply via email to