Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Maven Artifact Contains javax.ws.rs.Path?

Tags:

java

maven

jax-rs

I am working through examples in Restful Java with JAX-RS by Bill Burke. I'm using intellij and created a Maven project to make a "Hello World" web service. I understand that JAX-RS is a specification, and not an implementation. I would like to try the Apache CXF implementation.

How do I find out what jar, or what Maven artifact contains the necessary classes to:

import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.GET;
like image 628
David Williams Avatar asked Dec 02 '22 18:12

David Williams


2 Answers

Add below lines in pom.xml

<dependency>
    <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.0</version>
</dependency>
like image 199
Vivek Bansal Avatar answered Dec 11 '22 00:12

Vivek Bansal


Try searching for the class on Central. It looks like jaxrs-api is what you're looking for; there are a couple of different packagers, and which one you want is probably whichever goes with your container.

like image 43
chrylis -cautiouslyoptimistic- Avatar answered Dec 11 '22 01:12

chrylis -cautiouslyoptimistic-