Building

Click uses an Ant based build system for creating JAR files, application WAR files and the Click distribution.
  1. Build Configuration
  2. Ant Targets
  3. Framework Dependencies
  4. Extras Dependencies
  5. Third-party Licensing Issues

 

1.  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
|
+--[documentation]              Click documentation set application
|
+--[examples]                   Click Examples application
|   |
|   +---build.xml               Ant build script
|   |  
|   +---README.txt              Click Examples Readme file
|
+--[extras]                     Click Extras source directory
|
+--[framework]                  Click framework source directory
|
+--[lib]                        Dependent JAR libraries directory
|
+--[mock]                       Mock objects source directory 

1.1  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.5 or later).

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

  3. Ensure junit.jar is present in your ANT_HOME/lib directory.

2.  Ant Targets

ant help
Buildfile: build.xml

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

     [echo] Main targets:

     [echo] build-all             build framework, extras, examples
     [echo] build-distribution    build distribution ZIP file
     [echo] build-examples        build click-examples WAR 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-mock            build mock JAR file
     [echo] build-sources         build source ZIP files for use with IDEs
     [echo] checkstyle            run checkstyle report on Java source
     [echo] deploy-examples       copy examples WAR files to app 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] project-quick-start   build application template
     [echo] test-all              run all unit tests


     [echo] Please ensure you have configured build.properties


BUILD SUCCESSFUL 

2.1  Getting Dependencies

  1. Run the Ant target get-deps to download JAR dependencies from the 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 

2.2  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 

2.3  Building 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 

2.4  Building Examples

To build the Click Examples and Click QuickStart web application WAR files:
  1. Please see the examples/README.txt file, ensuring the required properties have been configured and the dependencies downloaded.

  2. Ensure the above configurations have been made and get-deps has been run.

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

3.  Framework Dependencies

The Click framework has the following runtime dependencies.
Library Version JAR / Source Author Description
Java Runtime 1.5 n/a Sun Microsystems J2SE Runtime Environment
Servlet API 2.3 servlet-2.3.jar Sun Microsystems JEE Servlet API
Velocity Engine 1.7 velocity-1.7.jar* Apache Velocity Velocity Templating Framework
Velocity Tools 2.0 WebappResourceLoader source** Jakarta Velocity Tools Velocity Tools Utility Library
OGNL 2.6.9 ognl-2.6.9.jar * OGNL Object Graph Navigation Library
Common Language 2.5 commons-lang-2.5.jar * Jakarta Commons General Language Utilities Library
Common FileUpload 1.2.1 commons-fileupload-1.2.1.jar * Jakarta Commons HTTP File Upload Library
Commons Codec 1.4 commons-codec-1.4.jar * Jakarta Commons Encoding Decoding Library
Commons Collections 3.2.1 commons-collections-3.2.1.jar * Jakarta Commons Collection Utilities Library
Common IO 2.0.1 commons-io-2.0.1.jar * Jakarta Commons IO Utilities Library
* : marked JAR libraries or Java source are included in the click.jar file.

** : marked JAR libraries or Java source are included in both the click.jar and click-nodeps.jar files.

The standard click-xx.jar includes all of the listed dependencies.
Alternatively use the click-nodeps-xx.jar which includes none of these dependencies (except dependencies marked with **, which are included in both jars).

4.  Extras Dependencies

The Click Extras has the following runtime dependencies in addition to the Framework dependencies.

Please note: a runtime dependency is only required if you use the specific library. For example, if you use Hibernate, you need hibernate.jar on your classpath, otherwise it is not needed.

Library Version JAR Author Description
Cayenne 3.0 cayenne-server-3.0.jar Apache Cayenne ORM Framework
Freemarker 2.3.16 freemarker-2.3.16.jar Freemarker Alternate Template Engine to Velocity
Hibernate 3.2.6 hibernate-3.2.6.ga.jar Hibernate ORM Framework
Log4J 1.2.16 log4j-1.2.16.jar Log4j Logging Framework
Spring 2.5.6 spring-2.5.6.jar Spring Framework IoC Framework
Prototype 1.6.1 JavaScript source* Prototype Org JavaScript library
script.aculo.us 1.8.3 JavaScript source* script.aculo.us JavaScript library
* : marked JavaScript sources are included in the click-extras.jar file.

5.  Third-party Licensing Issues