Enterprise Java Development@TOPIC@
Figure 18.2. Multi-Module Approach Candidate Module Structure
eLeague |-- eLeague | +--eLeagueBO | | |-- pom.xml | | `-- src | | |-- main | | | `-- java | | | `-- eleague | | | |-- bo | | | `-- bl | | `-- test | | |-- java | | | `-- eleague | | | `-- bo | | `-- resources | | `log4j.xml | +--eLeagueDAO | | |-- pom.xml | | `-- src | | |-- main | | | |-- java | | | | `-- eleague | | | | |-- dao | | | | `-- jpa | | | `-- resources | | | `-- ddl | | | |-- eLeague-create.ddl | | | `-- eLeague-drop.ddl | | | `-- (eLeague-tuning.ddl or within create) | | `-- test | | |-- java | | | `-- eleague | | | `-- dao | | `-- resources | | |-- log4j.xml | | `-- META-INF | | `-- persistence.xml | +--eLeagueBLImpl | | |-- pom.xml | | `-- src | | |-- main | | | `-- java | | | `-- eleague | | | `-- blimpl | | `-- test | | |-- java | | | `-- eleague | | | `-- bl | | `-- resources | | `-- log4j.xml | `-- pom.xml |-- eClub | ("it is simple" keep to a single module as shown above) `-- pom.xml
Since the work of project 1 will be deployed to the application server in follow-on projects, the persistence.xml definitions created in project 1 should be considered strictly for test and should be placed in the "src/test" tree to prevent it from being deployed to the application server. It is also suggested that if your persistence unit is called "X", the persistence unit name for project 1 in the "src/test" tree be called "X-test" to avoid confusion of what is intended to be used.