users@jersey.java.net

[Jersey] Re: Repackaging Jersey 1.x jars without jax-rs

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 18 Jun 2013 17:23:00 +0200

Hi,

Please feel free to file a new issue against Jersey 1.x. We do not however have any immediate plans to release new Jersey 1.x version that would fix the issue. Just curious - what forces you to have both Jersey 1.x and JAX-RS 2.0 on the same class path?

Marek

On Jun 17, 2013, at 7:26 PM, Ian Simpson <ian.g.simpson_at_gmail.com> wrote:

> I'm looking at using Jersey 2.0 and I'm trying to tackle the issue of having both the 1.x and 2.x jax-rs classes within the same classpath.
>
> The jersey-core Maven dependencies for 1.x all bundle the jax-rs classes inside, which is undesirable from a class loading standpoint when using Jersey 2.x since you need jax-rs 2.0. There's an excellent blog post outlining this concern here: http://sleeplessinslc.blogspot.com/2012/10/jax-rs-20-jersey-20-preview-example.html
>
> JUnit has a similar issue with including hamcrest, which creates issues if you use Maven to block duplicate classes. There's also a junit-dep jar that's available which doesn't include this package.
>
> Can a similar thing be done retroactively and deployed to Maven central for the Jersey 1.x jars? Perhaps create a jersey-core-nodeps or something along those lines? I could repackage the jars myself and upload them to my organization's internal Nexus instance, but it would be preferable to have them available via Central.
>
> I'm also open to the fact that I may be missing the obvious solution or an easy alternative. If that's the case please call out my obliviousness.