Using Guice with Jersey (2.6) 25 Mar 2014
In my company we love 2 things (among others), JAX-RS (Jersey) and dependency injection (Guice). We are used to those 2 implementations and we want to keep using them. But unfortunatly they do not really like each other … But things are getting better. The guys from Jersey have implemented a great feature (even if still far from being perfect) which is a kind of injection bridge.
Basically it lets you use your own dependency injection framework within Jersey. You are not forced to use HK2. In our case we want to use Guice.
But the setup of this bridge can be tricky, so one of my collegue from MYCOM decided to share the way we are able to make it work.
Please have a look to our repository where we share the code to make Jersey 2.6 and Guice work together. Do not hesitate to comment the code here.