Jersey 2.x(2.6)所需的Maven依赖项 [英] Maven dependencies needed for Jersey 2.x (2.6)

查看:460
本文介绍了Jersey 2.x(2.6)所需的Maven依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Jersey 1.x(1.2)迁移到2.x(2.6),我无法确定确切的Maven依赖项,jersey文档不够全面,没有提及什么是Maven依赖项新版本需要.

I'm trying to migrate from Jersey 1.x (1.2) to 2.x (2.6), I have trouble identifying the exact maven dependencies, jersey documentation is not comprehensive enough, it doesn't mention what maven dependencies are needed for the new version.

有人能获得Jersey 2.x(2.6)所需的Maven依赖项的完整列表吗?

Does anyone have comprehensive list of maven dependencies needed for Jersey 2.x (2.6)?

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

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

推荐答案

对于servlet环境,唯一需要的依赖项是

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>

这将吸收您所需的一切.如果您在Servlet 2.5环境中,那么可以使用它

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>

有关2.5 servlet的更多信息,请参见此处

Further information about 2.5 servlet, can be seen here

或者,您可以从Maven原型创建项目,如此处

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

请注意,使用Jersey 2.6的重要性在于它是支持Java 6的最新版本.如果您不需要这样做,我建议您使用

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.

这篇关于Jersey 2.x(2.6)所需的Maven依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆