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?
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.