Uploaded image for project: 'Cactus'
  1. Cactus
  2. CACTUS-126

JarList reference for cactifywar task

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Ant Integration
    • None
    • All platforms

    Description

      When using the cactifywar ant task one can inject additional libraries into the cactified war by using the nested lib element. The problem is that there is no way to inject a whole list of jars by reference. In a more advanced build design one is likely to use the new ant 1.6 import feature which allows a build to inherit the majority of its functionality. In such a situation it is very awkward to have to override the ant task responsible for calling the cactifywar task just to add a few more libraries.

      To be fair this problem is really a deficiency in the Ant War and Jar tasks. To fix it one will probably want to create a new datatype that supports mulitple jars. An example usage of the sort of thing I am talking about is demonstrated below.

      <jarlist id="my.jarlist.ref">
      <lib file="somefile.jar"/>
      <lib file="someotherfile.jar"/>
      </jarlist>

      <cactifywar srcfile="${dist.home}/${war.name}"
      destfile="${dist.home}/${cactus-war.name}"
      mergewebxml="${cactus-web.path}">
      <classes dir="${testbuild.classes.dir}"/>

      <jarlist refid="my.jarlist.ref"/>

      <servletredirector/>
      <servletredirector name="ServletRedirectorSecure"
      mapping="/ServletRedirectorSecure" roles="test"/>
      <filterredirector mapping="/test/filterRedirector.jsp"/>
      </cactifywar>

      Such functionality would let one do things like this in the ant task:
      <project name="ExampleWebComponent" default="usage" basedir=".">
      <import file="../webcomponentbuild.xml"/>

      <target name="init.jarlist.refs" depends="init.properties">

      <!-- Compile Classpath -->
      <jarlist id="my.jarlist.ref">
      <lib file="somefile.jar"/>
      <lib file="someotherfile.jar"/>
      </jarlist>
      </target>
      </project>

      There are lots of potential variations on the sort of thing I am describing. The objective is bury the details of calling the cactifywar task in an imported ant file and only override the target necessary to set a reference to a list of jars to pack into the cactified war.

      Note: A fileset reference won't work well for the jarlist datatype since all the jars would then have to be under a single directory.

      Attachments

        Activity

          People

            paranoiabla Petar Tahchiev
            nawkboy James Carpenter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: