Table of Contents
This chapter provides advice on how to organize your project so that you can set up dependencies in Maven. Alternatively, you might want to run the Maven archetype - as described in Appendix A, Using the Maven Archetype. This sets up the same general project structure as described in this chapter, though some of the details as to how dependencies are resolved varies from the approach described below. See Section 3.7, “Alternative Approach” for more details.
If you ran the Naked Objects archetype then you'll have a Maven parent module with a number of child modules:
xxx/pom.xml xxx-dom/pom.xml # domain object model xxx-fixture/pom.xml # fixtures for seeding object store xxx-service/pom.xml # in-memory object store implementations of repositories xxx-commandline/pom.xml # for deploying as a commandline, also for prototyping xxx-webapp/pom.xml # for deploying as a webapp
Using JPA Objects means writing new repository implementations which will depend on JPA Objects. In order to isolate those dependencies, we recommend that you create a new Maven submodule:
xxx/pom.xml xxx-dom/pom.xml xxx-fixture/pom.xml xxx-service/pom.xml xxx-service-jpa/pom.xml # JPA object store implementations of repositories xxx-commandline/pom.xml xxx-webapp/pom.xml
In addition, the dom and fixture projects also need updating, the dom project to reference the JPA Objects' applib and the fixture project in order to use the new JPA service implementations.