Hi there,

I'm pretty new to RESTlet so I apologize in advance if this is a dumb question.

We're developing a library which adds a JSON abstraction layer on top of 
RESTlet and which only depends on the core APIs and org.restlet.ext.jackson. It 
does not place any constraints on the application environment, i.e. it is J2SE 
/ J2EE agnostic. Furthermore we would actually like to use our library in two 
applications: one being J2EE based and the other being J2SE.

Since we are using Maven for our build environment we are forced to choose 
between the J2SE or the J2EE editions of RESTlet which is kind of awkward.

It looks like the subject may have already come up before, although I couldn't 
find a conclusion:

    http://restlet.markmail.org/thread/4iuvsvs6dklodeqw

The only potential workaround that I can think of is to build our library using 
a dependency on one of the editions (e.g. J2EE) and then require that the J2SE 
based application(s) exclude the transitive dependencies of the library and 
override them with its own:

<project xmlns="http://maven.apache.org/POM/4.0.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  ...
  <dependencies>

    <!-- Pull in my library, but exclude its J2EE RESTlet dependencies -->

    <dependency>
      <groupId>com.example</groupId>
      <artifactId>my-restlet-library</artifactId>
      <version>1.0.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.restlet.jee</groupId>
          <artifactId>org.restlet</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.restlet.jee</groupId>
          <artifactId>org.restlet.ext.jackson</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Now override with the correct J2SE RESTlet edition -->

    <dependency>
      <groupId>org.restlet.jse</groupId>
      <artifactId>org.restlet</artifactId>
      <version>2.0.9</version>
    </dependency>
    <dependency>
      <groupId>org.restlet.jse</groupId>
      <artifactId>org.restlet.ext.jackson</artifactId>
      <version>2.0.9</version>
    </dependency>
    ...
  </dependencies>
  ...
</project>

This introduces a maintenance nightmare since it means that whenever the 
dependencies of our library change we need to fix the poms in each of our 
applications.

Thanks in advance,

Matt

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2910988

Reply via email to