Reputation: 9869
3.1. Standalone Resteasy
If you are using resteasy outside of JBoss AS 6, you will need to do a few manual steps to install and configure resteasy. RESTeasy is deployed as a WAR archive and thus depends on a Servlet container. We strongly suggest that you use Maven to build your WAR files as RESTEasy is split into a bunch of different modules. You can see an example Maven project in one of the examples in the examples/ directory
Also, when you download RESTeasy and unzip it you will see a lib/ directory that contains the libraries needed by resteasy. Copy these into your /WEB-INF/lib directory. Place your JAX-RS annotated class resources and providers within one or more jars within /WEB-INF/lib or your raw class files within /WEB-INF/classes.
Hi, is my confusion justified? I am using JBoss 5 unfortunately. Do I need to download RESTeasy and unzip it IF I am using Maven, as the documentation recommends? Maven grabs all the dependencies that are needed to build a project, including the RESTEasy fraemwork, right? So why the contradiction here? Wish that the documentation would anticipate common questions and be written more clearly.
Upvotes: 1
Views: 1360
Reputation: 15668
If you search for RESTeasy at Nexus you can find V2.3.2.Final in the repository. The extension is war. Use the following POM to include it in the Maven dependencies:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs-war</artifactId>
<version>2.3.2.Final</version>
</dependency>
Scope provided means that the container (JBoss) already comes with that library, so it doesn't have to be included in the release. However during development it has to be available since you compile against it.
To summarize:
When you are not using Maven (not recommended)
Also, when you download RESTeasy and unzip it you will see a lib/ directory that contains the libraries needed by resteasy. Copy these into your /WEB-INF/lib directory. Place your JAX-RS annotated class resources and providers within one or more jars within /WEB-INF/lib or your raw class files within /WEB-INF/classes.
When you are using Maven and not JBoss 6:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs-war</artifactId>
<version>2.3.2.Final</version>
</dependency>
When you are using Maven and JBoss 6:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs-war</artifactId>
<version>2.3.2.Final</version>
<scope>provided</scope>
</dependency>
Upvotes: 2