commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
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 <henrib@apache.org> 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
toolchains.xml?

> Cheers,
> Henrib
>
> --
> View this message in context: http://apache-commons.680414.n4.nabble.com/Math-How-to-select-a-specific-JDK-tp4634995p4635099.html
> Sent from the Commons - Dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message