Download the source release from
[Berlios]
or from
[Sourceforge].
Building GvTags from the source distribution:
-
- Add some necessary libraries to the directories WEB-INF/lib, WEB-INF/api-lib.
- See the file readme.txt in these directories to find out which libraries are needed.
- The simplest way to get the libraries is to copy them from the War Release.
- But don't copy the gvtags-*.jar, since it contains what you want to build.
- Compile by calling: ant compile.all
-
- Run standalone tests with: ant junit.test, this will take some minutes
-
- Create a war file for deployment by calling: ant gvtags.war
-
- Deploy the war files on your server, you can now see the test pages and examples
-
- Run the automated test for the test pages by calling: ant html.test.jsp for jsp tests (GvTags used in JSP)
-
- And call: ant html.test.gtl for gtl tests (GvTags template engine)
Working with eclipse and tomcat:
- Create a new tomcat project and set the workspace to the directory where you have unpacked the source distribution
-
- Copy the jar files from the groovy distribution to WEB-INF/lib, WEB-INF/api-lib as indicated above
-
- Go to Projects/Properties/Java Build Path/Source and modify the source path to include the src directory.
- The ouput folder is set to WEB-INF/classes by the sysdeo tomcat plugin.
- Go to Projects/Properties/Java Build Path/Libraries and add the groovy jars in WEB-INF/lib and WEB-INF/api-lib.
-
- The groovy files in the src directory must be explicitly compiled to class files since they will be part of the taglib jar.
- This can be done by calling ant with the goal compile.groovy.
I am using eclipse with the sysdeo plugin to develop the java files, monitor and
start the ant build for the groovy files.
To edit groovy files, I prefer jedit because the actual version has a nice syntax highlighting for groovy.
The compilation of groovy files is only needed for the groovy classes implementing
GvTags, because they must be deployed as class files in tomcat.
If code in a GvTag calls external groovy code, these classes are automatically compiled
by the underlying groovy script engine.