Configuring Jersey Declarative Linking in Bootique

In my previous post we talked about creating custom REST links with Jersey Declarative Linking. Configuring it for Bootique is extremely simple, but it's different than the Jersey Documentation on configuring it in a typical JAX-RS Application. 

First, here's the Package Info you'll need in your POM for Jersey Declarative Linking.


The Jersey User Guide (section 13.10) tells you to do something like the following, defining and registering your package for Declarative Linking support.

// Create JAX-RS application.

final Application application = new ResourceConfig()

This is where the confusion might come in for Bootique Users, since we're adding Declarative Linking to our Bootique Jersey Module configuration, not a straight-up JAX-RS application. Turns out adding it is a snap! No package declaration or registration required. Simply add the DeclarativeLinkingFeature class as a Bootique Jetty Module Feature and you're good to go!

public void configure(Binder binder) {



Source Code Notes for this Post

Source code discussed in this post is found in NixMash Microservices on GitHub. Code for this particular post is found in branch microservices-v0.1.0 – Initial Layout and Structure.