To start with, we're going to have dependencies on JPA
Objects, on a JDBC driver, and on
SLF4J (used by Hibernate). Add these to a
<properties>
section:
<properties> <jpaobjects.version>1.0.0</jpaobjects.version> <!-- or whatever --> <postgresql.jdbc.version>8.3-603.jdbc3</postgresql.jdbc.version> <!-- eg for PostgreSQL JDBC driver --> <slf4j.version>1.4.3</slf4j.version> </properties>
Next, in the parent module's
<dependencyManagement>
section, add in entries
for:
for JPA Objects:
<dependencyManagement> <dependencies> ... <dependency> <groupId>org.starobjects.jpa</groupId> <artifactId>applib</artifactId> <version>${jpaobjects.version}</version> </dependency> <dependency> <groupId>org.starobjects.jpa</groupId> <artifactId>runtime</artifactId> <version>${jpaobjects.version}</version> </dependency> <dependency> <groupId>org.starobjects.jpa</groupId> <artifactId>tools</artifactId> <version>${jpaobjects.version}</version> </dependency> ... </dependencies> </dependencyManagement>
Note that this will transitively bring in Hibernate
for the JDBC driver:
<dependencyManagement> <dependencies> ... <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>${postgresql.jdbc.version}</version> </dependency> ... </dependencies> </dependencyManagement>
for SLF4J:
<dependencyManagement> <dependencies> ... <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-nop</artifactId> <version>${slf4j.version}</version> <scope>test</scope> </dependency> ... </dependencies> </dependencyManagement>
Lastly, add a reference to the new Maven submodule that will hold the JPA repository implementations:
<modules> <module>dom</module> <module>fixture</module> <module>service</module> <module>service-jpa</module> <!-- JPA implementations --> <module>commandline</module> <module>webapp</module> </modules>