Building

Click uses an Ant based build system for creating JAR files, application WAR files and the Click distribution.

 

Build Configuration

The configuration of the Click Ant build system is detailed below:
+--[build]                      Ant build directory
|   |
|   +---build.xml               Ant build script
|   |
|   +---build.properties        Ant build properties
|   
+--[dist]                       JAR and WAR file output directory
|
+--[extras]                     Click Extras source directory
|
+--[framework]                  Click framework source directory
|
+--[lib]                        Dependent JAR libraries directory
|
+--[webapps]                    Web applications
    |
    +---[click-blank]           Click Blank starter application
    |
    +---[click-cayenne]         Click Cayenne ORM example application
    |
    +---[click-documentation]   Click documentation set application
    |
    +---[click-examples]        Click Examples application 

Build Requirements

Ensure the following requirements are met before performing builds:
  1. Ensure JAVA_HOME environment variable is set and points to a JDK installation (1.4 or later).

  2. Ensure ANT_HOME environment variable is set and points to an Ant installation (1.6.5 or later).

Ant Targets

ant help
Buildfile: build.xml

help:
     [echo] Click web application framework
     [echo] ===============================

     [echo] Main targets:

     [echo] build-all             build framework, extras, webapps
     [echo] build-distribution    build distribution ZIP file
     [echo] build-extras          build click-extras JAR file
     [echo] build-framework       build click framework JAR file
     [echo] build-maven-bundles   build Maven repository upload bundles
     [echo] build-sources         build source ZIP files for use with IDEs
     [echo] build-webapps         build web application WAR files
     [echo] deploy-webapps        copy WAR files to application server
     [echo] get-deps              download JAR dependencies
     [echo] get-deps-proxy        download JAR dependencies via proxy
     [echo] help                  display the Help message
     [echo] javadoc               create Javadoc HTML files


     [echo] Please ensure you have configured build.properties


BUILD SUCCESSFUL 

Getting Dependencies

  1. Run the Ant target get-deps to download JAR dependencies from Ibiblio Maven repository:
    ant get-deps 
    If you are behind a firewall use the Ant target get-deps-proxy and configure you proxy settings in build.properties
    # Proxy hostname used by Ant target 'get-deps-proxy'
    proxy.host=192.168.0.3
    
    # Proxy port for by Ant target 'get-deps-proxy'
    proxy.port=3128 

Building Framework

To build the Click framework JAR file click.jar
  1. Ensure the above configurations have been made and get-deps has been run.

  2. Run the Ant target build-framework to build the framework:
    ant build-framework 

Building Click Extras

Click Extras JAR file click-extras.jar
  1. Ensure the above configurations have been made and get-deps has been run.

  2. Run the Ant targets framework and build-extras:
    ant build-framework build-extras 

Building Click Webapps

To build the Click web application WAR files click-blank.war and click-examples.war
  1. Ensure the above configurations have been made and get-deps has been run.

  2. Run the Ant target build-all:
    ant build-all 

Framework Dependencies

The Click framework has the following runtime dependencies.
Library Version JAR / Source Author Description
Java Runtime 1.4 n/a Sun Microsystems J2SE Runtime Environment
Servlet API 2.3 servlet-2.3.jar Sun Microsystems J2EE Servlet API
Velocity Engine 1.5-dev velocity-1.5-dev.jar* Jakarta Velocity Velocity Templating Framework
Velocity Tools 1.1 WebappLoader source* Jakarta Velocity Tools Velocity Tools Utility Library
Common Language 2.1 commons-lang-2.1.jar * Jakarta Commons General Language Utilities Library
Common FileUpload 1.0 commons-fileupload-1.0.jar * Jakarta Commons HTTP File Upload Library
Commons Codec 1.3 commons-codec-1.3.jar * Jakarta Commons Encoding Decoding Library
Commons Collections 3.1 commons-collections-3.1.jar * Jakarta Commons Collection Utilities Library
DHTML Calendar 1.0 JavaScript source* Dynarch.com DHTML Calendar Widget
* : marked libraries and source are included in the click.jar file.

The standard click-xx.jar includes all of the listed dependencies.
Alternatively use the click-nodeps-xx.jar which includes none of these dependencies.