Maven dependencies needed for Jersey 2.x (2.6)

て烟熏妆下的殇ゞ 提交于 2019-11-28 13:31:52

For a servlet environment, the only dependency you need is

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

This will pull in all you need. If you are in a servlet 2.5 environment, then you would use this instead

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

Further information about 2.5 servlet, can be seen here

Alternatively, you could create a project from a Maven archetype, as seen here

UPDATE

Just as a note, the significance of using Jersey 2.6 is that it is the last version to support Java 6. If this is not a requirement for you, I would recommend using the latest version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!