Thursday, June 19, 2008

Using Groovy with Seam 2.0 in Netbeans 6.1

Of course, Seam 2.0 is ready to go with Groovy support which is great news! However, for someone who is not interested in using Seam Gen it is not very straight forward. This is true especially if one wishes to use Eclipse or Netbeans for their development environment.

A while back, I wrote a blog about developing Seam applications on Netbeans and deploying to Glassfish ( I need to post an update blog because I am now deploying Seam 2.0 apps to Glassfish Version 2 using Netbeans. I'd like to add a bit of syntactic candy into the process now and include Groovy support into my Netbeans Seam projects.

Simply add the following to your build.xml file (contained within the root of your Netbeans project) and modify paths accordingly. You will also need to package groovy-all.jar with your application. Once completed, you can add Groovy files suffixed with .groovy into your project Seamlessly. At compile time, they will be compiled into Java classes.

<target name="-pre-compile">
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${classpath-to-groovy}" />
<groovyc destdir="${classes.dir}">
<pathelement path="${classpath-to-groovy}"/>
<javac source="1.5" target="1.5" debug="on"/>
<src path="${src.dir}"/>

No comments:

Post a Comment

Please leave a comment...