RESTful球衣的gradle依赖

时间:2017-08-15 17:24:17

标签: rest gradle jersey dependencies

使用jersey为现有的Web应用添加RESTful支持:

compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.25.1'

具有以下巨大的依赖关系

\--- org.glassfish.jersey.containers:jersey-container-servlet:2.25.1
     +--- org.glassfish.jersey.containers:jersey-container-servlet-core:2.25.1
     |    +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
     |    +--- org.glassfish.jersey.core:jersey-common:2.25.1
     |    |    +--- javax.ws.rs:javax.ws.rs-api:2.0.1
     |    |    +--- javax.annotation:javax.annotation-api:1.2
     |    |    +--- org.glassfish.jersey.bundles.repackaged:jersey-guava:2.25.1
     |    |    +--- org.glassfish.hk2:hk2-api:2.5.0-b32
     |    |    |    +--- javax.inject:javax.inject:1
     |    |    |    +--- org.glassfish.hk2:hk2-utils:2.5.0-b32
     |    |    |    |    \--- javax.inject:javax.inject:1
     |    |    |    \--- org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32
     |    |    +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
     |    |    +--- org.glassfish.hk2:hk2-locator:2.5.0-b32
     |    |    |    +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
     |    |    |    +--- org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32
     |    |    |    +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
     |    |    |    +--- org.glassfish.hk2:hk2-utils:2.5.0-b32 (*)
     |    |    |    \--- org.javassist:javassist:3.20.0-GA
     |    |    \--- org.glassfish.hk2:osgi-resource-locator:1.0.1
     |    +--- org.glassfish.jersey.core:jersey-server:2.25.1
     |    |    +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
     |    |    +--- org.glassfish.jersey.core:jersey-client:2.25.1
     |    |    |    +--- javax.ws.rs:javax.ws.rs-api:2.0.1
     |    |    |    +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
     |    |    |    +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
     |    |    |    +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
     |    |    |    \--- org.glassfish.hk2:hk2-locator:2.5.0-b32 (*)
     |    |    +--- javax.ws.rs:javax.ws.rs-api:2.0.1
     |    |    +--- org.glassfish.jersey.media:jersey-media-jaxb:2.25.1
     |    |    |    +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
     |    |    |    +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
     |    |    |    +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
     |    |    |    +--- org.glassfish.hk2:hk2-locator:2.5.0-b32 (*)
     |    |    |    \--- org.glassfish.hk2:osgi-resource-locator:1.0.1
     |    |    +--- javax.annotation:javax.annotation-api:1.2
     |    |    +--- org.glassfish.hk2:hk2-api:2.5.0-b32 (*)
     |    |    +--- org.glassfish.hk2.external:javax.inject:2.5.0-b32
     |    |    +--- org.glassfish.hk2:hk2-locator:2.5.0-b32 (*)
     |    |    \--- javax.validation:validation-api:1.1.0.Final
     |    \--- javax.ws.rs:javax.ws.rs-api:2.0.1
     +--- org.glassfish.jersey.core:jersey-common:2.25.1 (*)
     +--- org.glassfish.jersey.core:jersey-server:2.25.1 (*)
     \--- javax.ws.rs:javax.ws.rs-api:2.0.1

太多了。我只期待几个罐子。 Web应用程序在tomcat中运行。 我需要包括球衣容器吗?将jersey添加到现有Web应用程序的最小依赖项是什么?

1 个答案:

答案 0 :(得分:0)

jersey-container-servlet是服务器API的最小值,如果您使用Maven将其拉入。我过去没有使用maven尝试过,最后不得不手动捕获几乎所有这些罐子。坚持使用maven。