This is a follow-up from my post two days ago “seam-gen and multiple projects“.

After some feedback from “atao” in this thread on the JBoss Seam forum, I have taken a different approach to the problem, and have enhanced seam-gen to generate targets within the generated project’s ant build script, which in turn call the related seam-gen tasks. This is more elegant for two reasons. Firstly, the projects are independent and don’t rely on special configs kept outside of the project. Secondly, you can run those tasks from within your IDE (Eclipse for me) while doing development. You don’t have to fire up a command prompt, navigate to your seam installation, and run the seam-gen commands there. All in all a much better solution. Thank you very much “atao” for the better approach.

The changes made to the seam-gen related files are slightly more extensive than the previous approach, but well worth it.

First: in $SEAM_HOME/seam-gen/build-scripts you need to change to contain this:

[email protected]@
[email protected]@

Second: in $SEAM_HOME/seam-gen/build-scripts you need to add the following block at the bottom of the build file (just before the tag):

Finally, in $SEAM_HOME/seam-gen you need to make a few edits to build.xml:

in the definition of the “project” filterset, within the “init-properties” target, you need to add the following filter (I put mine right after line 97 of revision 1.90):

Then, in the “file-copy” target, you need to add the following task call (I put mine on line 632 of revision 1.90):

If you want to just download the enhanced files here they are (based on the current head as of today):