Convenience library for starting the SimplyRESTful API on a Jetty server with Apache CXF.
What this library does:
- Registers the JAX-RS providers required by SimplyRESTful.
- Provides convenience to register the JAX-RS Web Resources.
- Makes the registered JAX-RS Web Resources available directly under the root of the path.
- Generates an OpenAPI Specification document at
/swagger.json
- Provides a Swagger UI at
/api-docs
.- Tip: If you access Swagger UI with
/api-docs?url=../swagger.json
it automatically loads the generated OpenAPI Specification file of the API.
- Tip: If you access Swagger UI with
To use it in your project you have to:
- Depend on
deploy-jetty-cxf
- Implement your SimplyRESTful API according to the standard instructions.
- You do not need to depend on the SimplyRESTful library directly as it is already pulled in by this library.
- You do not have to follow the steps to configure your JAX-RS framework since this library takes care of most of that automatically.
- Build the Jetty
Server
object using theServerBuilder
.- Use
withWebResource()
to register your JAX-RS Web Resources in Apache CXF. - You can also provide the address where the server should be hosted. (default:
http://localhost:9000
).
- Use
- Use the
Server
object to start your SimplyRESTful API.
See the example project for a simple example of how this library can be used.