I have a multi-project build and in each of the projects I have several packages in the main src tree which need to be packaged up separately from the rest of the src as individual EJB artifacts:
com/foo/ejb/ejb1
com/foo/ejb/ejb2
...
There can be an arbitrary number of these EJBs in each project (0 or several). My question is, how do I create a task that can, per project, Jar each of these as separate artifacts after the regular compile/jar? I.e. So I end up with following artifacts for each project:
project.jar (usual Java classes)
ejb1.jar (MyEjb1Home/Remote/Bean.class, META_INF/[descriptors])
ejb2.jar (MyEjb2Home/Remote/Bean.class, META_INF/[descriptors])
...
The task(s) should be something I can share to each project (so probably defined in root project) and that will automatically find EJB src and generate a jar for each, without having to explicitly define the EJBs in the subprojects (but perhaps a property set "containsEjbs" to narrow down subprojects that have EJBs).
I'm thinking along the lines of using a filetree to grab the src package (com.foo.ejb.*) and then iterating and Jar-ing - but its how to do this Jar-ing in the context of Tasks which is what I'm having trouble with.
Thanks for any help, Chris.