javajerseyjersey-client

Do I need the "jersey-client" dependency on server side to support clients implemented with it?


I am implementing a RESTful server with Jersey and I am currently struggling to set up my maven dependencies correctly. I use an Apache Tomcat as the servlet container. According to the documentation I need to include the jersey-client dependency only when I am using the JAX-RS Client.

The way I understand that, is that I need to include the client dependency in my server side application to support clients developed with jersey. Is that correct?

Or is it meant in the way, that the client dependency is actually only needed in the client application?


Solution

  • The Jersey client is solely meant to be used as an HTTP client to make requests to other remote servers. That's it. You only need the client if you need to make requests to remote servers from inside your server application. The client should already be automatically pulled in by the server dependencies though. Whether or not some other client is using the Jersey client has no bearing on whether or not you need to include the Jersey client dependency in your Jersey server app.