import-bot (20211) [Avatar] Offline
[Originally posted by andersengstrom]


Thanks for an excellent book smilie

I'm setting up a J2EE project (for the n-th time..), and got inspired by the
chapter about managing large projects through a masterbuild file and

I'd really like to keep my EJB-module separated from the WEB-module. The
WEB-module would have a dependecy on the EJB-module (the WEB-module would use
the ejb-client.jar).

My idea is to let each of these sub-projects have the standard default, dist,
clean targets. The EJB-project would deliver an ejb.jar and an ejb-client.jar.
The WEB-project would deliver a war-file.

I'm thinking this would work nicely. But - the "final" deliverable from the
project would be an EAR-file, incorporating the ejb.jar and the war-file and
common library dependencies (like log4j.jar for example).

Should I have another sub-project, called "deploy", that depends on the
EJB-module and the WEB-module and constructs the final EAR-file. Or should
this be the responsibility of the masterbuild?

Any other ideas on "modular" J2EE project setups?

Best Regards //Anders
import-bot (20211) [Avatar] Offline
Re: J2EE and sub-projects
[Originally posted by erikhatcher]

Anders - have a look at my JavaDevWithAnt project at
JavaDevWithAnt - it separates EJB and Web tiers similar to how you desire,
except all with a single
build file. Coordinating master build files with sub-build files is a last
resort for me - I much
prefer a single build file to control the entire process personally. I do
have separate build files for
deploy versus build though.
import-bot (20211) [Avatar] Offline
Re: J2EE and sub-projects
[Originally posted by andersengstrom]

Thanks for the reply.

I've tried this setup too - and I'll have a look at the way you've done it smilie

IMO putting all "modules" in a monolithic tree makes the directory structure
harder to understand - but I may have over-complicated things in my setup...

For now i put the webapp and ejb in separat sub-projects, and use the
master-buildfile to package the EAR and deploy/un-deploy. It works fine for
now smilie