cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Josten <>
Subject Re: compiling a custom transformer
Date Fri, 10 Jun 2005 16:53:33 GMT

I typically use an Ant build file like the following. It assumes sources are located in a
subdir, custom libs are located in lib/, and that a environment variable named COCOON points
to the 
base of the Cocoon web application..


<!-- $Id$-->

<project name="cocoonext" default="jar" basedir=".">

     Build the cocoon libraries using Ant.

     You MUST have an environment variable named COCOON, which points to
     the directory containing the cocoon 'webapp' directory, e.g.
         export COCOON="/home/user/cocoon"
         set COCOON "E:software\cocoon-2.1.4\build"
     This may be set from your own build.bat or file.

     Of course, the jar file that is produced by the build process must be
     copied into the Cocoon lib-directory after the build process.
     The jar-files in the lib-directory must also be copied to the Cocoon lib.

   <property environment="env"/>
   <property name="cocoon.lib" location="${env.COCOON}/webapp/WEB-INF/lib"/>
   <property name="src" location="org"/>
   <property name="lib" location="lib"/>
   <property name="build" location="build"/>
   <property name="jarname" location="cocoonext"/>

   <target name="init">
     <mkdir dir="${build}"/>

   <target name="compile" depends="init" description="compile all sources" >
     <javac srcdir="${src}" destdir="${build}">
         <pathelement path="${classpath}"/>
         <fileset dir="${cocoon.lib}">
           <include name="**/*.jar"/>
         <fileset dir="${lib}">
           <include name="*.jar"/>

   <target name="jar" depends="compile" description="generate the jar-file" >
     <jar jarfile="${jarname}.jar" basedir="${build}"/>

   <target name="clean" description="clean up" >
     <delete dir="${build}"/>


Lars Huttar wrote:
> Hello,
> I've been wanting to use the ValidationTransformer and 
> ValidationTransformerReporter described on the wiki at 
> The source code is given in some java files but I'm having trouble 
> compiling them.
> In particular, the code has imports for various other Cocoon components. 
> I could add all the .jar files Cocoon uses into the CLASSPATH, but that 
> would be pretty laborious.
> What is the normal mechanism for compiling such Java files? Of course I 
> will then want toput the classes into a jar, install that in the right 
> place, and have Cocoon find it.
> Can I accomplish all that by putting the files into a new block? If so, 
> what is the procedure for creating a block?
> I have searched around on and the wiki for info on 
> creating a block, but all I see is documentation about how a block 
> should or could work.
> Any help would be appreciated.
> I contacted the author a couple of weeks ago but have not received a reply.
> Lars
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

NB: het Daidalos kantoor is sinds 22 april
jl. gevestigd op een nieuw adres:

Daidalos BV
Hoekeindsehof 1 - 4
2665 JZ Bleiswijk
tel: +31 (0)10 850 12 00
fax: +31 (0)10 850 11 99

Bovenstaand adres is tevens het postadres.
IT-consultant at Daidalos BV

GPG: 1024D/12DEBB50

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message