Site Network: Personal | Professional | Photography

Technical Blog

This blog will contain content related to Java, Seam, Security, my sites and projects, as well as other technical subjects I am interested in.

Comments and questions are welcome!

seam-gen and multiple projects part two

Sunday, August 19th, 2007

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.

(more...)

seam-gen and multiple projects

Friday, August 17th, 2007

seam-gen is a command line tool (although the new JBoss Tools eclipse plugin supports an Eclipse driven version as well) which can be used to create new Seam projects with a basic set of files, configs, and templates. It can also update the Seam jars in the project, do deployments, echo settings, create new actions, new forms, new entities, and so on. It is very handy, not only for developers who are just starting out with Seam, but also for experienced Seam developers (who might have customized the template resources which seam-gen uses to create the project framework).

The one big gap with seam-gen is that it keeps it's project settings in a build.properties file in the seam-gen directory of the seam project (which I checkout from CVS as an Eclipse project, making it easy to update). What this means is that there is only one project supported. If I use seam-gen to create a new project called shoestore, then I create another project called yourspace, now I can't use seam-gen to create a new form in shoestore, or update shoestore to the latest Seam jars.

Obviously if you're only working on one project at a time, this isn't a problem, but I tend to have multiple projects going at once. A couple existing applications in maintenance mode, a couple projects under development, and maybe a project or two to test something out in. So tonight I've made a couple of tiny changes to to the seam-gen tool, and the ant build.xml file it uses, which allow you to create, and continue to work with, any number of projects using seam-gen.

The two files to change are the seam (or seam.bat if you are using Windows) executable file (found in the root directory of your Seam downloaded (or checked-out) project) and the build.xml ant build file found inside the seam-gen directory, within the Seam project.

(more...)