Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

Installation guide for the Groovy and Gant Toolset

Run the Groovy and Gant Toolset in your Windows development environment

  • Print
  • Feedback

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:\JavaWorld\Groovy_Gant\ThirdPartyTools\groovy-1.0
    
    and create a new Windows environment variable GROOVY_HOME                  .
  7. Copy the path to your Groovy\bin directory into the clipboard like so:
    G:\JavaWorld\Groovy_Gant\ThirdPartyTools\groovy-1.0\bin
    
    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 .groovy\lib 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>\.groovy\lib 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!

About the author

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.

  • Print
  • Feedback

Resources

Additional downloads needed for this guide:

  • Groovy: A dynamic language for the Java platform.
  • Gant: Groovy plus Ant
  • JavaCC: A Java parser that understands Java 5 syntax.
  • Apache Axis2: A complete re-design and re-write of the widely used Apache Axis SOAP stack, built on the lessons learned from Apache Axis. Apache Axis2 is the core engine for Web services.
  • XFire: Codehaus XFire is a next-generation Java SOAP framework, built on a low-memory StAX-based model for high performance.
  • CXF: Apache CXF is an open source Web services framework. It is the merger of XFire and IONA's Celtix project into a new project, Apache CXF, currently under incubation at the Apache Software Foundation.
  • Java 6: From JDK 6 you will need rt.jar and tools.jar, but only if you want to use Java 6 wsimport with Java 5 installed. Note that you do not have to install a Java 6 JRE to use wsimport with the Groovy and Gant Toolset.