0

Is it possible to configure Jersey 2.26.x that it solely depends on Spring for injection instead of HK2? I know Jersey is nowadays compatible with Spring, but is it also possible to get completely rid of HK2?

1 Answers1

1

No it isn't. Jersey uses many special features of hk2 (such as good integration with Spring and Guice) in order to function

jwells131313
  • 2,364
  • 1
  • 16
  • 26
  • 7
    Starting in 2.26, Jersey actually got rid of HK2 as a hard dependency. It [stole some of your classes](https://github.com/jersey/jersey/tree/master/core-common/src/main/java/org/glassfish/jersey/internal/inject), added its own packaging, and now makes the DI provider pluggable through an InjectionManager. There's currently [CDI and HK2](https://github.com/jersey/jersey/tree/master/inject) implementations. – Paul Samsotha Aug 10 '17 at 23:39
  • I guess that's true for customer applications. They still use hk2 heavily internally – jwells131313 Aug 15 '17 at 12:56