Enterprise Java Development@TOPIC@

Chapter 18. Project 1 Getting Started

The following sketch of two directory structures can be used as a starting point for your overall application. The first is a simplified project layout that collapses the number of sub-projects into a single "Impl" project. It is suggested that you use this layout if you are new to maven and want the simplest configuration possible. The second is a more robust layout and is closer to a multi-developer environment. Use the later structure if you want to better simulate a work environment where the work of multiple developers needs clearer separation.

Note

All "e"Market, "e"Sales, and "e"Bidbot names should be changed to your specific name mangler. The same type of modification needs to occur for the java package names.

Note

Other than a README, it is not anticipated that you will have any artifacts at the root layer. It should be used only as a convenience wrapper to perform goals across both projects. The root project can also be used for common property, dependencyManagement, and pluginManagement defintions. All concrete dependency and plugins should be defined in the leaf-level poms to avoid unwanted dependencies from the root or mid-level parents.

Figure 18.1. Single Module Approach Candidate Module Structure

eMarket
|-- eSales
|   +--eSalesImpl
|   |   |-- pom.xml
|   |   `-- src
|   |       |-- main
|   |       |   |-- java
|   |       |   |   `-- esales
|   |       |   |       |-- bo
|   |       |   |       |-- dao
|   |       |   |       |-- jpa
|   |       |   |       |-- bl
|   |       |   |       |-- blimpl
|   |       |   `-- resources
|   |       |       `-- ddl
|   |       |           |-- eSales-create.ddl
|   |       |           `-- eSales-drop.ddl
|   |       `-- test
|   |           |-- java
|   |           |   `-- esales
|   |           |       |-- bo
|   |           |       |-- dao
|   |           |       `-- bl
|   |           `-- resources
|   |               |-- log4j.xml
|   |               `-- META-INF
|   |                  `-- persistence.xml
|   `-- pom.xml
|-- eBidbot
|   +--eBidbotImpl
|   |   |-- pom.xml
|   |   `-- src
|   |       |-- main
|   |       |   |-- java
|   |       |   |   `-- ebidbot
|   |       |   |       |-- bo
|   |       |   |       |-- dao
|   |       |   |       |-- bl
|   |       |   `-- resources
|   |       |       `-- ddl
|   |       |           |-- eBidbot-create.ddl
|   |       |           `-- eBidbot-drop.ddl
|   |       `-- test
|   |           |-- java
|   |           |   `-- ebidbot
|   |           |       |-- bo
|   |           |       |-- dao
|   |           |       |-- bl
|   |           `-- resources
|   |               |-- log4j.xml
|   |               `-- META-INF
|   |                  `-- persistence.xml
|   `-- pom.xml
`-- pom.xml

Figure 18.2. Multi-Module Approach Candidate Module Structure

eSales
|-- eSales
|   +--eSalesBO
|   |   |-- pom.xml
|   |   `-- src
|   |       |-- main
|   |       |   `-- java
|   |       |       `-- esales
|   |       |           |-- bo
|   |       |           `-- bl
|   |       `-- test
|   |           |-- java
|   |           |   `-- esales
|   |           |       `-- bo
|   |           `-- resources
|   |               `log4j.xml
|   +--eSalesDAO
|   |   |-- pom.xml
|   |   `-- src
|   |       |-- main
|   |       |   |-- java
|   |       |   |   `-- esales
|   |       |   |       |-- dao
|   |       |   |       `-- jpa
|   |       |   `-- resources
|   |       |       `-- ddl
|   |       |           |-- eSales-create.ddl
|   |       |           `-- eSales-drop.ddl
|   |       `-- test
|   |           |-- java
|   |           |   `-- esales
|   |           |       `-- dao
|   |           `-- resources
|   |               |-- log4j.xml
|   |               `-- META-INF
|   |                  `-- persistence.xml
|   +--eSalesBLImpl
|   |   |-- pom.xml
|   |   `-- src
|   |       |-- main
|   |       |   `-- java
|   |       |       `-- esales
|   |       |           `-- blimpl
|   |       `-- test
|   |           |-- java
|   |           |   `-- esales
|   |           |       `-- bl
|   |           `-- resources
|   |               `-- log4j.xml
|   `-- pom.xml
|-- eBidbot
|  ("it is simple" keep to a single module as shown above)
`-- pom.xml