My maven module pom.xml
looks like
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring3</artifactId>
<version>2.8</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.test.framework</groupId>
<artifactId>jersey-test-framework</artifactId>
<version>1.0.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
and a Resource class as
@Service
@Path("/hello")
public class HelloResource {
@GET
public Response hello() {
return Response.ok("Hello World!").build();
}
}
This all works fine.
Question
- I just saw this post, which says
You need both the JSR and the implementation. The annotations are in the JSR, the implementation provides supporting classes
May I know the reason why this is needed?