by Klaus P. Berg

Installation guide for the Groovy and Gant Toolset

feature
Nov 12, 20073 mins

Run the Groovy and Gant Toolset in your Windows development environment

In this companion to “Client-side WSDL processing with Groovy and Gant,” Klaus P. Berg shows you how to get his Groovy and Gant Toolset up and running on Windows XP or Windows Server 2003. While not shown, similar steps are needed to install the toolset for Linux or Mac OS X environments. The screenshot below shows what you will see after following the 10-step installation procedure:

Screenshot of the Groovy and Gant Toolset running in a Windows environment
Figure 1. Screenshot of the Groovy and Gant Toolset running in a Windows environment (click for a larger image)

Note that this guide assumes you have already read “Client-side WSDL processing with Groovy and Gant” and downloaded the Groovy and Gant Toolset and its associated files. You will also need to download CXF, Axis2, Gant, Groovy, Java 6 tools.jar & rt.jar (assuming you are running Java 5), and Xfire. See the Resources section for links.

  1. Create a root directory Groovy_Gant.
  2. Create the subdirectories ThidPartyTools and results.
  3. In the ThirdPartyTools directory install (unzip) CXF, Axis2, Gant, Groovy, Java 6 tools.jar & rt.jar (only if you are running Java 5), and Xfire.
  4. From the WebServicesClient.zip download the following zipped files:
    • Example_Client.zip (JUnit tests for the public GlobalWeather service)
    • Groovy-WSDL-Checker.zip (The Eclipse project with Groovy WSDL checker classes)
    • JarFiles_to_be_placed_in_USER_HOME_.groovy_lib.zip (everything you need to enrich Groovy)
    • JavaParser.zip (The JavaCC + Java stub modifier)
    • Java6.zip (contains Java 6 rt.jar & tools.jar, only necessary if you are still running Java 5 instead of Java 6)
    • wsdl.zip (contains sample WSDL files)
    • GroovyGant.zip (contains build.gant, build.properties, GetUserHomePath.groovy, Groovy_gant.epf)
  5. Extract all the ZIPs with option “use folder names” to your root directory Groovy_Gant.Now you should have a directory structure like the one presented in the screenshot above.
  6. Copy the path to your Groovy root directory into the clipboard like so:
    G:JavaWorldGroovy_GantThirdPartyToolsgroovy-1.0
    
    and create a new Windows environment variable GROOVY_HOME                  .
  7. Copy the path to your Groovybin directory into the clipboard like so:
    G:JavaWorldGroovy_GantThirdPartyToolsgroovy-1.0bin
    
    and add it to your Windows “path” environment variable. Now you are able to execute Groovy or Gant commands.
  8. In your root directory Groovy_Gant open a new DOS shell and type “groovy GetUserHomePath.groovy” to let the system display the path to your <USER_HOME> directory, that will be considered when you run Groovy or Gant.
  9. In your <USER_HOME> directory create the subdirectories .groovylib and copy all jar files from the JarFiles_to_be_placed_in_USER_HOME_.groovy_lib directory to this new location.
  10. If you want to play with the Groovy’s SOAP extension using my example code from the ExampleClient.zip file, you will also need groovysoap-all-1.0-0.3-snapshot_jdk1.5.0.jar in your <USER_HOME>.groovylib directory. This file can be downloaded from the Groovy homepage.

In your DOS shell you now can type “gant” and “gant -T” and you should see output like what you see in the screenshot above. That’s it — you are now ready to examine and use the Groovy and Gant Toolset!

Klaus P. Berg has an MS (diploma) in electrical engineering and applied informatics from the University of Karlsruhe in Germany. He was an architect and implementor for projects at Siemens focused on Java GUI development with Swing and Java Web Start as well as acting on the server side creating Java based intranet applications Now he works as a senior engineer in the area of software quality, functional and performance testing, mainly for J2EE software.