2

For a specific technical reason, I am interested in developing some lib outside of Dspace, that would be used in Dspace. However those lib will have some dependency on some dspace class like Item. I am thinking of simply adding things like Dspace-api as dependency during the development of the lib. The lib as to be a separate project from dspace.

What would be the proper way to re-integrate them after, that is, adding the lib as dependency to my Dspace Application. Would simply adding them as dependency to the "overalyed" e.g. Api be enough?

halfer
  • 19,824
  • 17
  • 99
  • 186
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127

1 Answers1

3

Make your add-on a maven project.

In its dependencies section, include a dependency to dspace-api of the correct version:

<dependencies>
    <dependency>
        <groupId>org.dspace</groupId>
        <artifactId>dspace-api</artifactId>
        <version>5.1</version>
        <scope>provided</scope>
    </dependency>
</dependencies> 

Add your add-on as a dependency to dspace-src/dspace/modules/additions/pom.xml

<dependencies>
  <dependency>
     <groupId>your-group-id</groupId>
     <artifactId>your-artifact-id</artifactId>
     <version>xyz</version>
  </dependency>
  ...
</dependencies>

If you're using an older DSpace version and there is no dspace-src/dspace/modules/additions/pom.xml file, I believe it will work to add the dependency to dspace-src/dspace-api/pom.xml instead. You will then need to use the full build option.

schweerelos
  • 2,189
  • 2
  • 17
  • 25
  • Thanks for the guidance here. Yes Working on 1.8.2 unfortunately can't change it – MaatDeamon May 27 '15 at 23:26
  • Cool, try the dspace-api pom, if that doesn't work then I guess ask again and mention that you're stuck on 1.8.2. ;) – schweerelos May 28 '15 at 01:42
  • 1
    You can make your own "additions" module in 1.8.x the same way it exists in later versions, just make sure to include it in the right places (modules pom, xmlui pom) – Antoine Snyers May 28 '15 at 08:53