Hi René, René Krell wrote:
> Hi Stephen, > >>... >>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) > > It's clear, that there are needed > separate > runtime libraries for compiling and running. > > I read already > about > animalsniffer, but it's more a JDK 1.6 project with partly real Java > 1.6 > code and I'd like to add some JDK 1.5 deployment for compatibility > reasons. > From my understanding the animalsniffer plugin is just a checker, > not more > (and not less). > > I thought about some compatibility module for all > other > modules, which aggregates build in a manner I need and includes and > excludes > stuff, but this might confuse a project, which has for instance 10 > or more > Maven modules, and some of them need to be "compatibilized". My > question is > rather whether there is a smarter way. > > Another approach would > be some > backport translator from a newer Java version to an older one. I > know only > translators back to Java 1.4, at the moment, as > retrotranslator. > > I would > appreciate an example project who practises > especially multiple deployments > for different target JREs. I'm sure there > are some :-) Another approach is taken in the XStream project. The resulting jar contains classes targetting different versions. Older JDKs simply do not use the classes that are only valid for newer JDKs. The code is generated using multiple executions of the compiler plugin: http://svn.xstream.codehaus.org/browse/xstream/trunk/xstream/pom.xml - Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
