On Tuesday, March 13, 2012 09:01:28 AM Christian Müller wrote:
> I'm working on CAMEL-4955 to get our build running in Java 7. Because of
> an issue in JAXB 2.1.13 and 2.2.4u1 I need a newer version of JAXB impl.
> JAXB impl 2.1.14 is not released yet and I'm wondering whether we should
> upgrade to JAXB API/impl 2.2.x. What are our constraints to upgrade Camel
> from JAXB API 2.1 to 2.2 and JAXB impl from 2.1.13 to 2.2.5?
> 
> [1] http://java.net/jira/browse/JAXB-860

Upgrading to JAXB 2.2 is not "easy" and not really something that is 
possible in Maven.   Basically, without using endorsed mechanisms, you will 
always get the version of the API that is provided by the JDK.   Thus, with 
JDK6, you get 2.1, with JDK 7, you get 2.2.    The only way to use the 2.2.x 
API's (and impl) on JDK6 is to endorse the 2.2 API jar which is not easy in 
Maven (and also not something you want all your users doing).

The only real option is to use JDK activated profiles in maven to pull in 
the appropriate IMPL.   We definitely don't need to pull in an API as it's 
pointless without endorsing.    In java6, pull in the latest 2.1.13/14 and 
on Java7, pull in 2.2.4/5.      CXF has ended up doing this.   (somewhat, we 
have an explicite "jaxws22" profile that is active on Java5 and Java7, but 
not on Java6)

BTW: despite the above "issues", I do think pulling in an explicit version 
of the impl (and xjc if needed) is a good thing.   The versions in the JDK 
are always behind the released version and generally have a bunch of bugs, 
classloader leaks, performance issues, etc...   What's worse, each JDK 
version has different issues so a user app may work with one jdk version, 
but not another, etc...   Making sure the users have a stable (er.. "known") 
version in a specific known state is good for us.    That's my opinion 
though.


-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to