下面的依赖通常应用到应用服务器上(servlet 容器),同时这个应用服务器上没有整合任何 JAX-RS 的实现。
因此,这个应用服务器需要包含有 JAX-RS API 和 Jersey 实现,同时部署到服务器上。
1 2 3 4 5 6 7 8 9 10 11 12 | <dependency> <groupId>org.glassfish.jersey.containers</groupId> <!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" --> <artifactId>jersey-container-servlet</artifactId> <version>2.27</version> </dependency> <!-- Required only when you are using JAX-RS Client --> <dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>2.27</version> </dependency> |