[opencms-dev] error in build-single.xml file for modules with additional libraries, fix

Christof Dallermassl ce-christof.dallermassl at bearingpoint.com
Thu Oct 13 16:04:29 CEST 2005


hi!

I develop a new module, but did not want the source inside the opencms directory tree. 
So I used the build-single.xml file with slight modifications as my build.xml.

My module needs some external jar files that are located in the 
${module-name}/resources/system/modules/${module-name}/lib
directory (=${module.input.lib})

The compile target in the build-single.xml file collects all jar files in the
${module.input.libs} directory and concatenates them to a classpath.

The code used (lines 289-296) are:
<for param="archive">
  <path>
    <fileset dir="${module.input.lib}" includes="*.jar"/>
  </path>
  <sequential>
    <var name="module.libs.path" value="${module.libs.path}:${module.input.lib}/@{archive}" />
  </sequential>
</for>

The problem is that @{archive} already holds the path and therefore
${module.input.lib}/@{archive} has the path twice. The solution is simple:

  <sequential>
    <var name="module.libs.path" value="${module.libs.path}:@{archive}" />
  </sequential>

Although my module is built a little different than the modules that come with opencms, the error
described above would also be a problem with opencms-modules. But as none of them seems to bring
additional libraries in the ${module.input.lib} path, no one noticed before :-)

my ant version is
"Apache Ant version 1.6.5 compiled on June 2 2005"
working on Linux, Kubuntu 5.10 (maybe this is linux/windows bug)

Thanks for the great work you all did on opencms! This is just my very small approach to 
make it even better.

regards
Christof



More information about the opencms-dev mailing list