This example demonstrates how to develop a simple OSGi bundle registering a Jersey based RESTful web service as an OSGi HttpService
The example bundle (see the bundle
module) consists of just one Jersey resource:
org.glassfish.jersey.examples.osgihttpservice.StatusResource
that produces a textual response to an HTTP GET
The mapping of the URI path space is presented in the following table:
URI path | Resource class | HTTP method |
---|---|---|
/status | StatusResource | GET |
To run the example, you would need to build the OSGi bundle in the bundle
module and install it to an OSGi runtime (e.g. Apache Felix) together with other OSGi bundles. Look at the attached functional-test
module for details on the programatical runtime configuration
To build the bundle jar file and run the tests, you can just launch
mvn clean install