ObjectDB ObjectDB

Maven and multiple JARs

#1

Perhaps beyond ObjectDB forum, but might be of interest to other ObjectDB users

In a multi-module maven web app project, with various modules dedicated to entity sets, using <jar-file> can be tricky, as the persistence.xml in the dependee modules can't know what jar files will become available "later" in downstream modules.

Example:

- Standalone core : CoreEnt, CoreEJB, CoreWeb (want be able to run too).

- Dependent more specific project: SpecEnt, SpecEJB, SpecWeb (downstream).

Just having 2 different persistence.xml (one for CoreEnt and one for SpecEnt) in the final build does not work (they clash giving deployment errors).

Clumsy workaround is to not have 2 persistence.xml, only the "downstream" one in SpecWeb, which may know which <jar-file> to include.

Am also looking into advanced maven usage suggestions (so can still have my executable CoreWeb cake and eat it):

https://stackoverflow.com/questions/45943148/persistence-unit-gets-overwritten

https://stackoverflow.com/questions/8085996/maven-overwrite-resource-file-in-dependency

edit
delete

Reply

To post on this website please sign in.