如果你使用的是 Glassfish 作为你应用服务器,你不需要在你的引用中包含引用任何东西,所有你需要的都已经包含进去了。
你只需要定义 JAX-RS API 以便于你能够对你的应用进行编辑,使用 (provided)依赖。
|
1
2
3
4
5
6
|
<dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> <version>2.1</version> <scope>provided</scope></dependency> |
如果你需要使用 Jersey 的一些特定特性,你需要基于你的 Jersey 目录进行添加。
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<dependency><groupId>org.glassfish.jersey.containers</groupId><artifactId>jersey-container-servlet</artifactId><version>2.27</version><scope>provided</scope></dependency><!-- if you are using Jersey client specific features without the server side --><dependency><groupId>org.glassfish.jersey.core</groupId><artifactId>jersey-client</artifactId><version>2.27</version><scope>provided</scope></dependency> |
https://www.cwiki.us/display/JERSEYZH/Common+Jersey+Use+Cases
Comments