Getting started with Maven

Introduction

Maven is a comprehensive project management system built around the concept of POM (Project Object Model). One of the main advantages is the automated handling of project dependencies, including their download. For more information on Maven, check the project home page.

Starting with version 2.5 of the Restlet Framework, all artifacts are published to Maven Central.

Public repository configuration

Here are some instructions about how to configure Maven client to work with the online Maven repository.

You should have Maven installed.

  • Go to Maven download page
  • Download the latest version of Maven and install it on your local computer
  • Add Maven bin folder to your PATH

Available artifacts

The following table lists the available artifacts and their group and artifact ids. With the introduction of the editions for the Restlet framework, it is necessary to make a distinction between an extension for a given edition and the same extension for another extension simply because the code of the extension may change between each edition. This distinction is reflected in the group id of all artifacts which contains a reference to an edition. They are all set on the same pattern: “org.restlet.<edition>” where “<edition>” is three-letters code of an edition among:

  • java (Java edition)
  • gwt (Google Web Toolkit edition),

You can find here a full view of the list of extensions and the editions that ship them. 

artifactId Description
org.restlet Restlet API
org.restlet.ext.atom Support for the Atom syndication and the AtomPub (Atom Publication Protocol) standards in their 1.0 version.
org.restlet.ext.crypto Support for cryptography.
org.restlet.ext.fileupload Integration with Apache FileUpload.
org.restlet.ext.freemarker Integration with FreeMarker.
org.restlet.ext.gae Integration to the Google App Engine UserService for the GAE edition.
org.restlet.ext.gson Support for GSON representations.
org.restlet.ext.gwt Server-side integration with GWT.
org.restlet.ext.html Support for the HTML (HyperText Markup Language) standard in its 4.0 version and above.
org.restlet.ext.httpclient Integration with Apache Commons HTTP Client.
org.restlet.ext.jaas Support for JAAS based security.
org.restlet.ext.jackson Integration with Jackson.
org.restlet.ext.jaxb Integration with Java XML Binding.
org.restlet.ext.jetty Integration with Jetty.
org.restlet.ext.json Support for JSON representations.
org.restlet.ext.odata Integration with OData services.
org.restlet.ext.osgi Support for the OSGi specification.
org.restlet.ext.rdf Support for the RDF parsing and generation.
org.restlet.ext.servlet Integration with Servlet API.
org.restlet.ext.slf4j Support for the SLF4J logging bridge.
org.restlet.ext.spring Integration with Spring Framework.
org.restlet.ext.thymeleaf Integration with Thymeleaf.
org.restlet.ext.velocity Integration with Apache Velocity.
org.restlet.ext.xml Support for the XML documents.
org.restlet.test Test module

Sample dependencies declaration

Each project based on the Restlet Framework needs to declare at least one dependency: the Restlet core module. According to your needs, you should complete the list of dependencies with the required extensions and connectors. For example, assuming your project is a Web server delivering static files, you need one HTTP server connector such as Simple. Since your Maven client correctly references the Restlet online repository, just open and edit the pom.xml file for your project and add the following lines of text into the <dependencies> section.

<dependency>
  <groupId>org.restlet</groupId>
  <artifactId>org.restlet</artifactId>
  <version>2.5.1</version>
</dependency>
<dependency>
  <groupId>org.restlet</groupId>
  <artifactId>org.restlet.ext.jackson</artifactId>
  <version>2.5.1</version>
</dependency>