You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by René Krell <re...@gmail.com> on 2010/08/03 13:20:49 UTC

Compiling and deploying for different JDKs

Hi all,

is there anybody who has a good example or can refer to a good
example project using Maven, which compiles and also deploys to different
jars using for instance JDK 1.5 and 1.6 one after the other. I found many
suggestions on the web, but they haven't been sufficient.

Just switching
the maven-compile-plugin to use different targets or local JDKs is not
enough because it basically makes one deployment, either for JDK 1.5 or JDK
1.6, regardless of other pitfalls of this solution.

I'd like to setup a
deployment for both JDKs in one deployment, deploying two or more different
JAR files (*-jdk16.jar and *-jdk15.jar), best withou switching profiles,
including some approach of a compatibility layer or lets say module which
might wrap code which cannot be compiled in a older JDK.

What is the best
way to achieve this?

Thx,
René

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compiling and deploying for different JDKs

Posted by Stephen Connolly <st...@gmail.com>.
But reading some more of your mail...

you don't want to do what you think you want to do.

The dependency requirements for JDK 1.5 and JDK 1.6 are different, so you
really want two separate artifacts with two separate pom.xml files.  I would
mostly keep everything with target 1.5 and compile using JDK 1.6.  Use
animal-sniffer to ensure that the JDK 1.5 modules only use the JDK 1.5 run
time API, and have the final artifacts that you produce include the required
missing deps from 1.5 that you need (e.g. the backports of the 1.6
concurrency stuff, etc)

-Stephen

P.S.

Why do you need to continue to support 1.5 as a dev env.  it is
End-Of-Life.  If you need to support it as a runtime env, use animal-sniffer

On 3 August 2010 12:36, Stephen Connolly <st...@gmail.com>wrote:

> toolchains
>
>
> On 3 August 2010 12:20, René Krell <re...@gmail.com> wrote:
>
>> Hi all,
>>
>> is there anybody who has a good example or can refer to a good
>> example project using Maven, which compiles and also deploys to different
>> jars using for instance JDK 1.5 and 1.6 one after the other. I found many
>> suggestions on the web, but they haven't been sufficient.
>>
>> Just switching
>> the maven-compile-plugin to use different targets or local JDKs is not
>> enough because it basically makes one deployment, either for JDK 1.5 or
>> JDK
>> 1.6, regardless of other pitfalls of this solution.
>>
>> I'd like to setup a
>> deployment for both JDKs in one deployment, deploying two or more
>> different
>> JAR files (*-jdk16.jar and *-jdk15.jar), best withou switching profiles,
>> including some approach of a compatibility layer or lets say module which
>> might wrap code which cannot be compiled in a older JDK.
>>
>> What is the best
>> way to achieve this?
>>
>> Thx,
>> René
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: Compiling and deploying for different JDKs

Posted by Stephen Connolly <st...@gmail.com>.
toolchains

On 3 August 2010 12:20, René Krell <re...@gmail.com> wrote:

> Hi all,
>
> is there anybody who has a good example or can refer to a good
> example project using Maven, which compiles and also deploys to different
> jars using for instance JDK 1.5 and 1.6 one after the other. I found many
> suggestions on the web, but they haven't been sufficient.
>
> Just switching
> the maven-compile-plugin to use different targets or local JDKs is not
> enough because it basically makes one deployment, either for JDK 1.5 or JDK
> 1.6, regardless of other pitfalls of this solution.
>
> I'd like to setup a
> deployment for both JDKs in one deployment, deploying two or more different
> JAR files (*-jdk16.jar and *-jdk15.jar), best withou switching profiles,
> including some approach of a compatibility layer or lets say module which
> might wrap code which cannot be compiled in a older JDK.
>
> What is the best
> way to achieve this?
>
> Thx,
> René
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>