commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [Math] How to select a specific JDK ?
Date Fri, 15 Jun 2012 11:01:31 GMT
On 15 June 2012 11:37, henrib <> wrote:
> Hello Gilles;
> Not sure this will fit your purpose but *toolchains* can be used to direct
> which JDK is used by Maven.
> You'd have to declare the various JDKs accessible in toolchains.xml (in
> $user.home/.m2) and configure the plugin in your pom.xml.
> By specifying the toolchains JDK vendor/version as properties in different
> profiles, it seems it should be possible to switch the JDK by running mvn
> with a -P flag.

That sounds very similar to what we have set up currently, except that
the user just needs to configure the JAVA_m_n_HOME properties, which
can be done in
settings.xml (also in $user.home/.m2).

It's slightly simpler as there is no need currently to configure any
plugins in any pom, as that has already been done in the parent pom.

Looks like it is more effort to set up the toolchains.xml file
initially - and AFAICT the setup cannot be bypassed by merely defining
the JAVA_m_n_HOME property at run-time. However, it would be easier to
configure for the case where one wants to use multiple vendors as well
as multiple java versions. And having the Java definitions in a
separate file would be a bit clearer.

With the current arrangement, Commons components can be built with the
default compiler without need to to do any additional setup; it's only
necessary to define the JAVA_1_x_HOME property if they wish to use an
alternate compiler via a -Pjava-1.x profile.

We do have one minor issue we have with the current approach.
The issue is that the manifest is generated by the java version used
to run Maven, so may not be the same as the actual compiler version if
the -Pjava-1.x profile is used.

Can toolchains solve this? And if a developer only wants to build/test
using their default compiler, would they still have to configure

> Cheers,
> Henrib
> --
> View this message in context:
> Sent from the Commons - Dev mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message