Maven repositories

Introduction

The Maven support appeared to be important for many Restlet users. The initial response was to automatically generate the POM files for each module JAR shipped within the Restlet distribution. This enabled users to upload those JAR files to a local Maven repository, using a script like the one available in the Wiki.

But, this was clearly not easy enough and forced users to download the full distribution for each new version released, instead of just updating a couple of JARs. There also was issues with some third-party dependencies which aren't available in public Maven repositories, like the db4o, AsyncWeb or Simple.

That's why it has been decided to launch two dedicated Maven repositories. The first one is freely accessible from http://maven.restlet.org and contains all Restlet JARs and third party dependencies that aren't available in the main public Maven repository. It will be automatically refreshed on the 1st and on the 15th of each month.

Another repository is available at http://maven.noelios.com for the customers who subscribed to one of the professional support plans. This repository is directly integrated with the release process and as soon as a new release is made, it is available from this repository, with no further delay.

Public repository configuration

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

  1. 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
  2. Declare the repository for your project or for a parent project by updating the pom.xml file and adding the following code to the <repositories> section:
    <repository>
       <id>maven-restlet</id>
       <name>Public online Restlet repository</name>
       <url>http://maven.restlet.org</url>
    </repository>
       
  3. As an alternative, you can also declare the repository for all of your projects. Go to the directory on the local computer where you just install Maven. Open and edit conf/settings.xml file. Add to the <profiles> section the following code:
    <profile>
      <id>restlet</id>
      <repositories>
         <repository>
            <id>maven-restlet</id>
            <name>Public online Restlet repository</name>
            <url>http://maven.restlet.org</url>
         </repository>
      </repositories>
    </profile>
       
    Just after the </profiles> add the following:
    <activeProfiles>
        <activeProfile>restlet</activeProfile>
    </activeProfiles>
       

Available artifacts

Group id Artifact id Description
org.restlet org.restlet Restlet API
org.restlet org.restlet.example Examples
org.restlet org.restlet.ext.fileupload FileUpload extension
org.restlet org.restlet.ext.freemarker Freemarker extension
org.restlet org.restlet.ext.json JSON extension
org.restlet org.restlet.ext.spring Spring integration
org.restlet org.restlet.ext.velocity Velocity integration
com.noelios.restlet com.noelios.restlet Noelios Restlet Engine, reference implementation of the Restlet API
com.noelios.restlet com.noelios.restlet.asyncweb AsyncWeb connector
com.noelios.restlet com.noelios.restlet.httpclient HttpClient connector
com.noelios.restlet com.noelios.restlet.javamail JavaMail connector
com.noelios.restlet com.noelios.restlet.jdbc JDBC connector
com.noelios.restlet com.noelios.restlet.jetty Jetty connector
com.noelios.restlet com.noelios.restlet.net Net connector
com.noelios.restlet com.noelios.restlet.servlet Servlet connector
com.noelios.restlet com.noelios.restlet.simple Simple connector

Sample dependencies declaration

Each project based on the Restlet framework needs to declare at least two dependencies: the Restlet API and its implementation, the NRE. 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>1.0.1</version>
</dependency>
<dependency>
   <groupId>com.noelios.restlet</groupId>
   <artifactId>com.noelios.restlet</artifactId>
   <version>1.0.1</version>
</dependency>
<dependency>
   <groupId>com.noelios.restlet</groupId>
   <artifactId>com.noelios.restlet.ext.simple</artifactId>
   <version>1.0.1</version>
</dependency>