users@jersey.java.net

Re: [Jersey] Re: Jersey as pure OSGi bundles

From: Richard Wallace <rwallace1979_at_gmail.com>
Date: Wed, 17 Jun 2009 09:05:04 -0700

On Wed, Jun 17, 2009 at 3:32 AM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
>
> On Jun 17, 2009, at 8:21 AM, Richard Wallace wrote:
>
>> I've added more modules, like the jersey-bundle and the other
>> top-level subprojects.  I also added bundle information for the
>> jersey-guice submodule.
>
> OK, great this is most helpful.
>
>
>>  I'd like to get a release pushed out to one
>> of my local maven repos for further testing, but this is causing
>> problematic as the Jersey build relies on the maven-istack-plugin
>> which is at version 0.1-SNAPSHOT.
>
> Yes, we bundle the classes of that module in the jersey-server jar so as to avoid an explicit runtime dependency. What problems does it cause?

Well, the sneaky bundling of the 1.1-SNAPSHOT stuff doesn't cause a
problem. Though it would be good to use a released version for build
reproducibility, especially before the next release. The problem is
caused by that maven-istack-plugin. Maven sees that there is a
SNAPSHOT dependency and refuses to allow a release to proceed. This
is for a good reason, as you should be able to rebuild a released
version indefinitely. But, by relying on a SNAPSHOT, you don't have
that guarantee because the SNAPSHOT could go away or be superceded by
a more recent version which doesn't behave exactly the same as the
version you released with originally. See
<http://www.sonatype.com/people/2009/01/best-practices-for-releasing-with-3rd-party-snapshot-dependencies/>
for a good description of the problem and why SNAPSHOT usage should be
as short lived as possible.


Rich

>
>
>>  It doesn't look like the plugin has
>> been touched in about 6 months.  Who do we need to talk to about
>> getting a release of that plugin done?
>>
>
> Jakub would know more about that.
>
> Paul.
>
>> Rich
>>
>> On Sun, Jun 14, 2009 at 5:05 PM, Richard
>> Wallace<rwallace_at_thewallacepack.net> wrote:
>>>
>>> Hey all,
>>>
>>> I've done some work on making the Jersey modules real OSGi bundles.
>>> I've been doing this work on a branch I created on GitHub
>>> <http://github.com/rwallace/jersey-osgi-ified/tree/master>.  I now
>>> have the jersey-core, jersey-server and jersey-json loading and
>>> working in an OSGi framework (tested on Felix 1.8.0), without having
>>> to do any hacks or classloading tricks in application code.  Just
>>> create the ServletContainer and go!
>>>
>>> To do this I used the ServiceMix OSGi Locator code from
>>> <https://svn.apache.org/repos/asf/servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/>.
>>>  I was trying to use it out of the box, but they made the assumption
>>> in the BundleFactoryLoader implementation that only a single
>>> implementation would appear in the META-INF/services files.  This
>>> doesn't work for Jersey, so I had to make some minor modifications to
>>> get everything happy.  Other than that, I just added the
>>> maven-bundle-plugin to the build of the submodules and cleaned up the
>>> Import-Package declarations.
>>>
>>> Another bit of work I had to do was to make the jsr311-api use the
>>> ServiceMix OSGiLocator code as well.  I don't have that published at
>>> the moment, but if you want me to put it up on GitHub that's easy
>>> enough.
>>>
>>> You can see I didn't do all the modules.  I left the jersey-client,
>>> jersey-atom, and the jersey-fastinfoset alone.  I didn't try these yet
>>> because I don't use them so don't really have a good way to test them.
>>>  But they should be just as simple as the jersey-json one was, and
>>> someone with a way to test that they're really working should be able
>>> to get it done quickly enough.  I left the jersey-bundle one alone for
>>> similar reasons, thinking that once the smaller modules are done it
>>> should be pretty easy to put it all together in the jersey-bundle.  It
>>> should really only require pom changes and merging the Import-Package
>>> settings of each of the submodules that are included in it.
>>>
>>> Let me know if you have any questions about what I did and how it
>>> works!  I'd love to see this included in the 1.1.1 release so I can
>>> upgrade from 1.0.2.
>>>
>>> Rich
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>