2

I have a project using Restlet 2.3.1 (JSE). We are using maven as per the Restlet website:

<properties>
  <restlet-version>2.3.1</restlet-version>
</properties>

<repositories>
    <repository>
      <id>maven-restlet</id>
      <name>Public online Restlet repository</name>
      <url>http://maven.restlet.com</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.restlet.jse</groupId>
      <artifactId>org.restlet</artifactId>
      <version>${restlet-version}</version>
    </dependency>
    <dependency>
      <groupId>org.restlet.jse</groupId>
      <artifactId>org.restlet.ext.jackson</artifactId>
      <version>${restlet-version}</version>
    </dependency>
    <dependency>
      <groupId>org.restlet.jse</groupId>
      <artifactId>org.restlet.ext.jetty</artifactId>
      <version>${restlet-version}</version>
    </dependency>
</dependencies>

This all works fine but when I try to add the RAML extension:

<dependency>
  <groupId>org.restlet.jse</groupId>
  <artifactId>org.restlet.ext.raml</artifactId>
  <version>${restlet-version}</version>
</dependency>

I get the following error:

ArtifactDescriptorException: Failed to read artifact descriptor for org.raml:raml-parser:jar:0.8.7: 
ArtifactResolutionException: Failure to transfer org.raml:raml-parser:pom:0.8.7 from http://download.java.net/maven/1 was cached in the local repository, resolution will not be reattempted until the update interval of maven1-java has elapsed or updates are forced. 
Original error: Could not transfer artifact org.raml:raml-parser:pom:0.8.7 from/to maven1-java (http://download.java.net/maven/1): No connector available to access repository maven1-java (http://download.java.net/maven/1) of type legacy using the available factories AetherRepositoryConnectorFactory, WagonRepositoryConnectorFactory
DB5
  • 13,553
  • 7
  • 66
  • 71
tarka
  • 5,289
  • 10
  • 51
  • 75

1 Answers1

3

The problem here is that the org.restlet.jse:org.restlet.ext.raml artifact has a dependency to the org.raml:raml-parser:0.8.7 artifact. Unfortunately this artifact is not available in any repositories that you have configured Maven to use (in Maven Central it is only available in version 0.8.11).

The version you require is available in the Mulesoft maven repository: http://repository.mulesoft.org/releases/

Adding the following repository definition to your pom should solve your problem:

<repository>
    <id>mulesoft-releases</id>
    <name>MuleSoft Repository</name>
    <url>http://repository.mulesoft.org/releases/</url>
    <layout>default</layout>
</repository>

Update

If, as David suggests, you want to use the 0.8.11 version then instead of adding the Mulesoft repository you can simply modify your dependencies as follows:

<dependencies>
    <dependency>
        <groupId>org.restlet.jse</groupId>
        <artifactId>org.restlet.ext.raml</artifactId>
        <version>${restlet-version}</version>
        <exclusions>
            <!-- exclude transitive dependency (version 0.8.7) -->
            <exclusion>
                <groupId>org.raml</groupId>
                <artifactId>raml-parser</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- explicitly define dependency to version 0.8.11 -->
    <dependency>
        <groupId>org.raml</groupId>
        <artifactId>raml-parser</artifactId>
        <version>0.8.11</version>
    </dependency>

    <!-- other dependencies -->
</dependencies>
DB5
  • 13,553
  • 7
  • 66
  • 71
  • 1
    `0.8.11` should be compatible with `0.8.7` and has many bug fixes so it's maybe worth considering excluding the version that comes with `org.restlet.jse:org.restlet.ext.raml` and using the version in central instead. – David Dossot May 20 '15 at 02:10