【问题标题】:Maven dependencies needed for Jersey 2.x (2.6)Jersey 2.x (2.6) 所需的 Maven 依赖项
【发布时间】:2015-03-09 17:54:30
【问题描述】:

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

是否有人拥有 Jersey 2.x (2.6) 所需的 maven 依赖项的完整列表?

泽西文档 https://jersey.java.net/documentation/latest/migration.html#mig-1.x

【问题讨论】:

    标签: jersey jersey-2.0


    【解决方案1】:

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

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

    这将满足您的所有需求。如果您在 servlet 2.5 环境中,那么您将使用它来代替

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

    更多关于2.5 servlet的信息,可以看here

    或者,您可以从 Maven 原型创建一个项目,如 here 所示

    更新

    请注意,使用 Jersey 2.6 的意义在于它是支持 Java 6 的最后一个版本。如果这不是您的要求,我建议使用 latest version

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多