You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Badakhchani, Hussein" <Hu...@T-Motion.net> on 2001/03/08 15:04:20 UTC

ejbs, package structures, having your cake and eating it

Hello, I have just recently started using ant and it's great, but I need some help
or ideas to try and resolve a build situation at work, here's my problem

Our current directory structure looing like this

portal
  |----deploy
  |       |----appx
  |       |      |--META-INF
  |                     |---(one dirty great ejb-jar.xml file for implementation x)
  |                     |---(another dirty great ejb-jar.xml file for implementation y)
  |----src
  |     |--(packaged source code)
  |----build(where the container ejb-jar.jars sit in)
  |
build.xml
project.properties

When we run ant it basicly compiles all the source code under src then builds the ejb-jar files based on the deployment descriptors in the deploy directory. These deployment descriptors identify beans that are in one functional group.

Now I don't like this structure very much I would prefer something like this

portal
  |-----ejb1
  |       |---src
  |       |---deloy(individual descriptors for ejb's sharing common interfaces)
  |       |---build
  |       build.xml
  |       module.properties
  |
  |-----ejb2
  |       |---src
  |       |---deloy
  |       |---build
  |       build.xml
  |       module.properties
  |
build.xml
project.properties

The build.xml and project.properties files under protal, are used to encapsulate shared project information, the build then "asks" each module to build itself (perhaps passing some parameters to the
module build.xml) this works prefectly well, every bean is packaged into it's own jar. Unfortuately some of my collegues like there beans in functional groups and have objected to my proposed directory structure (even though they see the benefits) when I suggested that we could write a task to create EAR files to represent the functional groups they weren't impressed, so now I need to find an "easy" way to produce functional groups of ejb's from my modular structure, any help would be most appreciated.

I am moving towards the idea of writing an xml file for each functional group and using xslt in combination with a dirctory scanner to create the ejb-jar.xml files then jar these files in the usual way.

Thanks in advance.