Table of Contents
This chapter provides a quick introduction on how to get started building RESTful services using Jersey. The example described here uses the lightweight Grizzly HTTP server. At the end of this chapter you will see how to implement equivalent functionality as a JavaEE web application you can deploy on any servlet container supporting Servlet 2.5 and higher.
If you want to depend on Jersey snapshot versions the following repository needs to be added to the pom:
<repository>
<id>snapshot-repository.java.net</id>
<name>Java.net Snapshot Repository for Maven</name>
<url>https://maven.java.net/content/repositories/snapshots/</url>
<layout>default</layout>
</repository>
Now, to create a new Jersey project, based on Grizzly 2 container, from a maven archetype, execute the following in the directory where the new project should reside:
mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-grizzly2 -DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=false -DgroupId=com.example -DartifactId=simple-service -Dpackage=com.example -DarchetypeVersion=2.0-m09
Feel free to adjust the group id, package name and artifact id of your new project in the line above, or you can change it after it gets generated by updating the project pom.xml
TODO: instructions on how to make simple edits to the newly created resource