Maven Dependencies Required for Jersey 2.x (2.6)

I'm trying to move from Jersey 1.x (1.2) to 2.x (2.6), I have problems determining the exact maven dependencies, the jersey documentation is not comprehensive enough, it does not mention which maven dependencies are required for the new version.

Does anyone have an exhaustive list of maven dependencies required for Jersey 2.x (2.6)?

Jersey Dock https://jersey.java.net/documentation/latest/migration.html#mig-1.x

+6
source share
1 answer

For servlet environments, only one dependency is required:

<dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>2.6</version> </dependency> 

This will pull everything you need. If you are in a servlet 2.5 environment, you should use this instead

 <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet-core</artifactId> <version>2.6</version> </dependency> 

More information about 2.5 servlet can be seen here.

Alternatively, you can create a project from the Maven archetype, as shown here

UPDATE

As a note, the significance of using Jersey 2.6 is that the latest version supports Java 6. If this is not a requirement for you, I would recommend using the latest version .

+11
source

Source: https://habr.com/ru/post/980848/


All Articles