You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2003/03/22 17:47:15 UTC

cvs commit: maven/src/plugins-build/cactus maven.xml project.xml project.properties plugin.properties plugin.jelly

vmassol     2003/03/22 08:47:15

  Modified:    src/plugins-build/cactus project.xml project.properties
                        plugin.properties plugin.jelly
  Added:       src/plugins-build/cactus maven.xml
  Log:
  First cut at the 2.0 version which now uses the Ant Integration Module from the Cactus project
  
  Revision  Changes    Path
  1.14      +43 -91    maven/src/plugins-build/cactus/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/project.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- project.xml	22 Mar 2003 16:05:11 -0000	1.13
  +++ project.xml	22 Mar 2003 16:47:15 -0000	1.14
  @@ -5,7 +5,7 @@
     <pomVersion>3</pomVersion>
     <id>maven-cactus-plugin</id>
     <name>Maven Cactus Plug-in</name>
  -  <currentVersion>1.2</currentVersion>
  +  <currentVersion>2.0-SNAPSHOT</currentVersion>
     <description>Plugin for Cactus (http://jakarta.apache.org/cactus) that allows to automatically start containers, run Cactus tests and stop the containers.</description>
     <shortDescription>Cactus plugin</shortDescription>
     <url>http://maven.apache.org/reference/plugins/cactus/</url>
  @@ -33,19 +33,27 @@
         <name>1.2</name>
         <tag>MAVEN_CACTUS_1_2</tag>
       </version>
  +    <version>
  +      <id>2.0</id>
  +      <name>2.0</name>
  +      <tag>HEAD</tag>
  +    </version>
     </versions>
  +
     <developers>
  +
       <developer>
         <name>Vincent Massol</name>
         <id>vmassol</id>
  -      <email>vmassol@octo.com</email>
  -      <organization>OCTO Technology</organization>
  +      <email>vmassol@pivolis.com</email>
  +      <organization>Pivolis</organization>
         <roles>
           <role>Java Developer</role>
           <role>Architect</role>
           <role>Release Manager</role>
         </roles>
       </developer>
  +
       <developer>
         <name>Eric Pugh</name>
         <id>epugh</id>
  @@ -56,126 +64,70 @@
         </roles>
       </developer>
     </developers>
  +
     <contributors/>
  +
     <dependencies>
  +
  +    <!-- Build time dependencies -->
  +    
  +    <dependency>
  +      <groupId>cactus</groupId>
  +      <artifactId>jakarta-cactus-integration-ant</artifactId>
  +      <version>13-1.5dev-20030322</version>
  +      <type>zip</type>
  +    </dependency>
  + 
  +    <!-- Runtime dependencies -->
  +
       <dependency>
         <groupId>cactus</groupId>
  -      <artifactId>cactus</artifactId>>
  -      <version>13-1.4.1</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  +      <artifactId>cactus-framework</artifactId>>
  +      <version>13-1.5dev-20030322</version>
       </dependency>
  +
       <dependency>
         <groupId>cactus</groupId>
  -      <artifactId>cactus-ant</artifactId>>
  -      <version>1.4.1</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  +      <artifactId>cactus-integration-ant</artifactId>>
  +      <version>1.5dev-20030322</version>
       </dependency>
  +
       <dependency>
         <groupId>commons-httpclient</groupId>
         <artifactId>commons-httpclient</artifactId>>
  -      <version>2.0alpha1-20020829</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  +      <version>2.0-alpha3</version>
       </dependency>
  +
       <dependency>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>>
  -      <version>1.0.1</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  +      <version>1.0.2</version>
       </dependency>
  +
       <dependency>
         <groupId>aspectj</groupId>
         <artifactId>aspectjrt</artifactId>
         <version>1.0.6</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
       </dependency>
  +
       <dependency>
         <groupId>httpunit</groupId>
         <artifactId>httpunit</artifactId>
  -      <version>1.5</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  +      <version>1.5.1</version>
       </dependency>
  +
       <dependency>
  -      <groupId>nekohtml</groupId>
  -      <artifactId>nekohtml</artifactId>
  -      <version>0.6.5</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  +      <groupId>log4j</groupId>
  +      <artifactId>log4j</artifactId>
  +      <version>1.2.7</version>
       </dependency>
  +
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>3.8.1</version>
  -      <properties>
  -        <classloader>root</classloader>
  -      </properties>
  -    </dependency>
  -    <dependency>
  -      <groupId>ant</groupId>
  -      <artifactId>ant</artifactId>
  -      <version>1.5.1</version>
  -      <properties>
  -        <classloader>root</classloader>
  -      </properties>
  -    </dependency>
  -    <dependency>
  -      <groupId>commons-jelly</groupId>
  -      <artifactId>commons-jelly</artifactId>
  -      <version>20030211.141339</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  -    </dependency>
  -    <dependency>
  -      <groupId>commons-jelly</groupId>
  -      <artifactId>commons-jelly-tags-ant</artifactId>
  -      <version>20030211.142045</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  -    </dependency>
  -    <dependency>
  -      <groupId>commons-beanutils</groupId>
  -      <artifactId>commons-beanutils</artifactId>
  -      <version>1.4.1</version>
  -      <properties>
  -        <classloader>root.maven</classloader>
  -      </properties>
  -    </dependency>
  -
  -    <!-- Should not be needed but it seems there is a bug with Maven when junit
  -       dependency is added -->
  -    <dependency>
  -      <groupId>xml-apis</groupId>
  -      <artifactId>xml-apis</artifactId>
  -      <version>1.0.b2</version>
  -      <properties>
  -        <classloader>root</classloader>
  -      </properties>
  -    </dependency>
  -
  -    <!-- Should not be needed but it seems there is a bug with Maven when junit
  -       dependency is added -->
  -    <dependency>
  -      <groupId>xerces</groupId>
  -      <artifactId>xerces</artifactId>
  -      <version>2.0.2</version>
  -      <properties>
  -        <classloader>root</classloader>
  -      </properties>
       </dependency>
  +
     </dependencies>
   
   </project>
  
  
  
  1.3       +9 -0      maven/src/plugins-build/cactus/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/project.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.properties	10 Feb 2003 08:24:46 -0000	1.2
  +++ project.properties	22 Mar 2003 16:47:15 -0000	1.3
  @@ -6,3 +6,12 @@
   maven.checkstyle.format = turbine
   maven.license.licenseFile=${basedir}/../../../LICENSE.txt
   
  +# Properties specific to the plugin
  +
  +# Note: These should be removed once Maven artifacts dependencies 
  +# mechanism is finalized.
  +
  +maven.cactus.artifacts.zips.dir = ${maven.repo.local}/cactus/zips
  +maven.cactus.antintegration.version = 13-1.5dev-20030322
  +maven.cactus.antintegration.name = jakarta-cactus-integration-ant-${maven.cactus.antintegration.version}
  +maven.cactus.antintegration.zip = ${maven.cactus.artifacts.zips.dir}/${maven.cactus.antintegration.name}.zip
  
  
  
  1.5       +14 -61    maven/src/plugins-build/cactus/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/plugin.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- plugin.properties	3 Feb 2003 14:08:02 -0000	1.4
  +++ plugin.properties	22 Mar 2003 16:47:15 -0000	1.5
  @@ -8,71 +8,24 @@
   #
   # Examples:
   #
  -# maven.cactus.tomcat4x.home = c:/apps/tomcat-4.1.10
  -# maven.cactus.resin2x.home = C:/Apps/resin-2.1.4
  -# maven.cactus.weblogic7x.home = C:/bea
  -
  -# The default container to run in.  You must specifiy which one.
  -#
  -# Examples:
  -#
  -# maven.cactus.container=tomcat-4x
  -# maven.cactus.container=resin-2x
  -# maven.cactus.container=weblogic-7x
  -
  -
  -# Currently you must provide a web.xml to use.
  -maven.cactus.webxml=
  -
  -# DVSL Template to merge user web.xml to entries needed by Cactus
  -maven.cactus.webxml.dvsl = ${plugin.resources}/conf/web.xml.dvsl
  -
  -# Empty web.xml to use if the user project does not provide a web.xml file
  -maven.cactus.emptywebxml = ${plugin.resources}/conf/web.xml
  -
  -# Location of cactus.properties Cactus configuration file
  -maven.cactus.configFile = ${plugin.resources}/conf/cactus.properties
  +# cactus.home.tomcat4x = c:/apps/tomcat-4.1.10
  +# cactus.home.resin2x = C:/Apps/resin-2.1.4
  +# cactus.home.weblogic7x = C:/bea
   
   # Location of Cactus tests in project sources
  -maven.cactus.src.dir = src/test-cactus
  -
  -# Location of scripts for the different containers
  -maven.cactus.scripts.dir = ${plugin.resources}/scripts
  -
  -# Location of container configuration files
  -maven.cactus.conf.containers.dir = ${plugin.resources}/conf/containers
  -
  -# Location where the cactus plugin puts its generateds stuff in
  -# the project build directory.
  -maven.cactus.build.dir = ${maven.build.dir}/cactus
  -
  -# Location where the cactus plugin puts the compiled cactus test classes
  -maven.cactus.classes.dir = ${maven.cactus.build.dir}/classes
  -
  -# Location where the cactus plugin puts resources that need to be in the
  -# Cactus client side classpath.
  -maven.cactus.build.resources.dir = ${maven.cactus.build.dir}/resources
  -
  -# Port under which the container will be started
  -maven.cactus.port = 8080
  -
  -# If true, the junit task used to run the Cactus tests will output the
  -# test result to a file
  -maven.cactus.junit.usefile = true
  -
  -# Location of generated raw test reports
  -maven.cactus.test.reportsDirectory = ${maven.build.dir}/test-reports
  +cactus.src.dir = ${basedir}/src/test-cactus
   
  -# Define what TestRunner to use. Default is the JUnit text test runner
  -# (the one used by the <junit> Ant task). Valid values are: text, swing
  -maven.cactus.testrunner = text
  +# Location where the plugins puts temporary build-generated files
  +cactus.target.dir = ${maven.build.dir}
   
  -# Location of junit excluded.properties file to use when using the Swing
  -# Test Runner
  -maven.cactus.testrunner.swing.excluded = ${plugin.resources}/conf/excluded.properties
  +# Default port on which to start the containers
  +cactus.port = 8080
   
  -# Include/Exclude for Cactus tests
  -maven.cactus.test.fileset.include=**/*.class
  -maven.cactus.test.fileset.exclude=
  +# Default Cactus test files to include in the test
  +cactus.src.includes = **/*Test*.java
   
  +# Default Cactus test files to exclude from the test
  +cactus.src.excludes = **/AllTests.java,**/Test*All.java
   
  +# Default webapp context
  +cactus.context = cactustest
  
  
  
  1.7       +57 -443   maven/src/plugins-build/cactus/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/plugin.jelly,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- plugin.jelly	19 Mar 2003 11:54:15 -0000	1.6
  +++ plugin.jelly	22 Mar 2003 16:47:15 -0000	1.7
  @@ -2,474 +2,88 @@
   
   <!--
     =============================================================================
  -    Cactus plugin for Maven.
  +    Cactus plugin for Maven. It uses the Cactus Ant Integration from the 
  +    Cactus project.
     =============================================================================
   -->
  -<project xmlns:j="jelly:core" 
  -  xmlns:doc="doc"
  -  xmlns:cactus="jelly:org.apache.maven.cactus.CactusTagLibrary" >
  -
  -  <!-- Import all the jelly scripts found in the plugin-resources/scripts
  -       directory. They are jelly scripts to start/stop the different
  -       containers. -->
  -  
  -  <fileScanner var="scanner">
  -    <fileset dir="${plugin.resources}/scripts/" includes="*.jelly"/>
  -  </fileScanner>
  -
  -  <j:forEach var="script" items="${scanner.iterator()}">
  -    <j:import inherit="true" file="${script.toString()}"/>
  -  </j:forEach>
  +<project xmlns:j="jelly:core" xmlns:doc="doc">
   
  -  <!--
  -     ========================================================================
  -       Initialization. Creates objects useful for several goals.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:init">
  -
  -    <taskdef name="junit"
  -      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
  -
  -    <!-- Classpath containing all Cactus jars that are needed on Cactus
  -         client side -->
  -    <path id="cactus.classpath.clientside">
  -      <path refid="maven.dependency.classpath"/>
  -      <pathelement location="${maven.build.dest}"/>
  -      <pathelement location="${maven.cactus.classes.dir}"/>
  -      <pathelement location="${maven.cactus.build.resources.dir}"/>
  -      <pathelement path="${plugin.getDependencyPath('junit')}"/>
  -      <pathelement path="${plugin.getDependencyPath('cactus:cactus')}"/>
  -      <pathelement path="${plugin.getDependencyPath('commons-httpclient')}"/>
  -      <pathelement path="${plugin.getDependencyPath('commons-logging')}"/>
  -      <pathelement path="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
  -      <pathElement path="${plugin.getDependencyPath('httpunit')}"/>
  -      <pathElement path="${plugin.getDependencyPath('nekohtml')}"/>
  -      <!-- These 2 jars should not be needed but it won't work without
  -           them -->
  -      <pathelement path="${plugin.getDependencyPath('xml-apis')}"/>
  -      <pathelement path="${plugin.getDependencyPath('xerces')}"/>
  -    </path>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Compile Cactus tests.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:compile" prereqs="java:compile"
  -    description="Compile Cactus tests">
  -
  -    <mkdir dir="${maven.cactus.build.dir}"/>
  -    <mkdir dir="${maven.cactus.classes.dir}"/>
  -
  -    <javac
  -      destdir="${maven.cactus.classes.dir}"
  -      excludes="**/package.html"
  -      debug="${maven.compile.debug}"
  -      deprecation="${maven.compile.deprecation}"
  -      optimize="${maven.compile.optimize}">
  -      <classpath>
  -        <pathelement path="${maven.build.dest}"/>
  -        <path refid="maven.dependency.classpath"/>
  -        <pathelement path="${plugin.getDependencyPath('cactus:cactus')}"/>
  -        <pathelement path="${plugin.getDependencyPath('junit')}"/>
  -        <pathElement path="${plugin.getDependencyPath('httpunit')}"/>
  -      </classpath>
  -      <src>
  -        <path location="${maven.cactus.src.dir}"/>
  -      </src>
  -    </javac>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Create the Cactus webapp (i.e. add Cactus related jars/config/test
  -       classes to either the project war or the project webapp).
  -     ========================================================================
  -  -->
  -  <goal name="cactus:webapp" description="Create the Cactus webapp">
  -    
  -    <!-- this seems required to setup the plugin context -->
  -    <attainGoal name="war:init"/> 
  -    
  -    <j:set var="maven.cactus.prewar.dir" value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}"/>
  -    
  -    <available file="${maven.cactus.prewar.dir}/${pom.artifactId}.war"
  -      property="maven.cactus.prewar.exists"/>
  -
  -    <j:choose>
  -
  -      <j:when test="${maven.cactus.prewar.exists}">
  -
  -        <!-- Expand the project war -->
  -        <unwar src="${maven.cactus.prewar.dir}/${pom.artifactId}.war"
  -          dest="${maven.cactus.build.dir}/${pom.artifactId}"/>
  -        <attainGoal name="cactus:webapp-update"/>
  -
  -      </j:when>
  -
  -      <j:otherwise>
  -
  -        <available file="${maven.cactus.prewar.dir}/${pom.artifactId}/WEB-INF"
  -          type="dir" property="maven.cactus.prewebapp.exists"/>
  -
  -        <j:choose>
  -          <j:when test="${maven.cactus.prewebapp.exists}">
  -
  -            <copy todir="${maven.cactus.build.dir}/${pom.artifactId}">
  -              <fileset dir="${maven.cactus.prewar.dir}/${pom.artifactId}"/>
  -            </copy>
  -            <attainGoal name="cactus:webapp-update"/>
  -
  -          </j:when>
  -          <j:otherwise>
  -            <echo>
  -              Either a war or a webapp must exist. Please call the War plugin
  -              first.
  -            </echo>
  -          </j:otherwise>
  -        </j:choose>
  -
  -      </j:otherwise>
  -    </j:choose>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Generate a web.xml which is the merge betweem the user project web.xml
  -       and the webapp elements needed by Cactus.
  -     ========================================================================
  -  --> 
  -  <goal name="cactus:merge-webxml">
  -
  -    <j:set var="warWebXml"
  -      value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.webxml')}"/>
  -
  -    <available file="${warWebXml}"
  -        property="maven.cactus.webxml.exists"/>
  -
  -    <j:choose>
  -      <j:when test="${maven.cactus.webxml.exists}">
  -        <j:set var="webxml" value="${warWebXml}"/>
  -      </j:when>
  -      <j:otherwise>
  -        <j:set var="webxml" value="${maven.cactus.emptywebxml}"/>
  -      </j:otherwise>
  -    </j:choose>
  -
  -    <!-- FIXME: The Merge was done in DVSL.  I removed it, but haven't been able to duplicate it with JSL. 
  -    You need to provide a Cactus'ed web.xml to use.    
  -    -->
  -    <j:set var="cactuscheckwebxml" value="${maven.cactus.webxml}X"/>
  -    <j:choose>
  -      <j:when test="${cactuscheckwebxml == 'X'}">
  -        <echo message="You should provide in your project.properties a maven.cactus.webxml web.xml file to use.  Using default web.xml"/>
  -        <copy toFile="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/web.xml" overwrite="true"
  -          file="${plugin.resources}/conf/web.xml"/>        
  -      </j:when>
  -      <j:otherwise>
  -        <copy toFile="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/web.xml" overwrite="true"
  -          file="${maven.cactus.webxml}"/>
  -      </j:otherwise>
  -    </j:choose>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Generate an expanded Cactus webapp from a project expanded webapp.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:webapp-update" prereqs="cactus:compile">
  -
  -    <!-- Copy Cactus configuration files -->
  -    <copy todir="${maven.cactus.build.dir}/${pom.artifactId}"
  -      file="${plugin.resources}/conf/web/jspRedirector.jsp"/>
  -
  -    <!-- Create the web.xml which is result of merging the project web.xml
  -         and the elements needed by Cactus -->
  -    <attainGoal name="cactus:merge-webxml"/>
  -
  -    <!-- Copy Cactus jars -->
  -    <copy todir="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/lib"
  -      file="${plugin.getDependencyPath('cactus:cactus')}"/>
  -    <copy todir="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/lib"
  -      file="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
  -    <copy todir="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/lib"
  -      file="${plugin.getDependencyPath('commons-logging')}"/>
  -    <copy todir="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/lib"
  -      file="${plugin.getDependencyPath('junit')}"/>
  -    <copy todir="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/lib"
  -      file="${plugin.getDependencyPath('httpunit')}"/>
  -
  -    <!-- Copy Cactus tests -->
  -    <copy todir="${maven.cactus.build.dir}/${pom.artifactId}/WEB-INF/classes">
  -      <fileset dir="${maven.cactus.classes.dir}"/>
  -    </copy>
  -
  -  </goal>
  +  <!-- Global properties -->
  +  <property name="maven.cactus.antintegration.dir" 
  +    value="${plugin.resources}/jakarta-cactus-integration-ant"/>  
   
     <!--
        ========================================================================
  -       Test initialization.
  +       Initializations.
        ========================================================================
     -->
  -  <goal name="cactus:test-init">
  +  <goal name="cactus:init" prereqs="war:war">
   
  -    <path id="cactus.scanner.classpath">
  -      <path refid="maven.dependency.classpath"/>
  -      <pathElement location="${maven.build.dest}"/>
  -      <pathElement location="${maven.cactus.classes.dir}"/>
  -      <pathElement location="${plugin.getDependencyPath('cactus:cactus')}"/>
  -      <pathElement location="${plugin.getDependencyPath('commons-logging')}"/>
  -      <pathElement location="${plugin.getDependencyPath('junit')}"/>
  -      <pathElement location="${plugin.getDependencyPath('commons-httpclient')}"/>
  -      <pathElement location="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
  -      <pathElement location="${plugin.getDependencyPath('httpunit')}"/>
  -      <pathElement location="${plugin.getDependencyPath('nekohtml')}"/>
  -      <j:forEach var="lib" items="${pom.dependencies}">
  -        <pathElement location="${maven.repo.local}/${lib.artifactDirectory}/jars/${lib.artifact}"/>
  -      </j:forEach>
  +    <path id="cactus.classpath">
  +      <pathelement location="${maven.build.dest}"/>
  +      <pathelement path="${pom.getDependencyClasspath()}"/>
       </path>
   
  -    <cactus:scanner var="cactusScanner" classpathref="cactus.scanner.classpath">
  -      <fileset dir="${maven.cactus.classes.dir}">
  -        <include name="${maven.cactus.test.fileset.include}"/>
  -        <exclude name="${maven.cactus.test.fileset.exclude}"/>
  -      </fileset>
  -    </cactus:scanner>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Start the Cactus tests using the <junit> Ant task with the JUnit
  -       Text Test Runner.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:test-text" prereqs="cactus:test-init,cactus:init"
  -    description="Start the tests using the text runner">
  -
  -    <mkdir dir="${maven.cactus.test.reportsDirectory}"/>
  -    <mkdir dir="${maven.cactus.build.resources.dir}"/>
  -
  -    <copy todir="${maven.cactus.build.resources.dir}"
  -      file="${maven.cactus.configFile}" filtering="on">
  -      <filterset>
  -        <filter token="maven.cactus.port" value="${maven.cactus.port}"/>
  -      </filterset>
  -    </copy>
  -
  -    <junit printSummary="yes" fork="true" dir="${basedir}"
  -      failureProperty="maven.cactus.test.failure">
  -
  -      <formatter type="xml"/>
  -      <formatter type="plain" usefile="${maven.cactus.junit.usefile}"/>
  -      <classpath refid="cactus.classpath.clientside"/>
  -
  -      <j:forEach var="test" items="${cactusScanner.iterator()}">
  -        <test name="${test}" todir="${maven.cactus.test.reportsDirectory}"/>
  -      </j:forEach>
  -
  -    </junit>
  -
  -    <j:if test="${maven.cactus.test.failure}">
  -      <j:set var="cactusignore__" value="${maven.cactus.test.failure.ignore}X"/>
  -      <j:if test="${cactusignore__ == 'X'}">
  -        <fail message="There were test failures."/>
  -      </j:if>
  -    </j:if>
  -
  -  </goal>
  -
  - <!--
  -     ========================================================================
  -       Start only one Cactus test using the <junit> Ant task with the JUnit
  -       Text Test Runner.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:test-text-single" prereqs="cactus:test-init,cactus:init"
  -    description="Start the tests using the text runner">
  -
  -    <mkdir dir="${maven.cactus.test.reportsDirectory}"/>
  -    <mkdir dir="${maven.cactus.build.resources.dir}"/>
  -
  -    <copy todir="${maven.cactus.build.resources.dir}"
  -      file="${maven.cactus.configFile}" filtering="on">
  -      <filterset>
  -        <filter token="maven.cactus.port" value="${maven.cactus.port}"/>
  -      </filterset>
  -    </copy>
  -
  -    <junit printSummary="yes" fork="true" dir="${basedir}"
  -      failureProperty="maven.cactus.test.failure">
  -
  -      <formatter type="xml"/>
  -      <formatter type="plain" usefile="${maven.cactus.junit.usefile}"/>
  -      <classpath refid="cactus.classpath.clientside"/>
  -      <test name="${mavencactustestcase}"
  -        todir="${maven.cactus.test.reportsDirectory}"/>
  -    </junit>
  -
  -    <j:if test="${maven.cactus.test.failure}">
  -      <j:set var="cactusignore__" value="${maven.cactus.test.failure.ignore}X"/>
  -      <j:if test="${cactusignore__ == 'X'}">
  -        <fail message="There were test failures."/>
  -      </j:if>
  -    </j:if>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Start the Cactus tests using the <junit> Ant task with the JUnit
  -       Swing Test Runner.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:test-swing" prereqs="cactus:test-init,cactus:init"
  -    description="Start the tests using the swing runner">
  -
  -    <mkdir dir="${maven.cactus.build.resources.dir}"/>
  +    <j:set var="warBuildDir"
  +      value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}"/>
  +    <property name="cactus.war"
  +      value="${warBuildDir}/${pom.artifactId}.war"/>
  +
  +    <!-- TODO: Verify here that the war or webapp exists -->
  +    
  +    <property name="cactus.antintegration.jar"
  +      value="${plugin.getDependencyPath('cactus:cactus-integration-ant')}"/>
  +    <property name="cactus.framework.jar" 
  +      value="${plugin.getDependencyPath('cactus:cactus-framework')}"/>
  +    <property name="cactus.log4j.jar" 
  +      value="${plugin.getDependencyPath('log4j')}"/>
  +    <property name="cactus.aspectjrt.jar" 
  +      value="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
  +    <property name="cactus.commons.logging.jar" 
  +      value="${plugin.getDependencyPath('commons-logging')}"/>
  +    <property name="cactus.junit.jar" 
  +      value="${plugin.getDependencyPath('junit')}"/>
  +    <property name="cactus.httpunit.jar" 
  +      value="${plugin.getDependencyPath('httpunit')}"/>
  +    <property name="cactus.commons.httpclient.jar" 
  +      value="${plugin.getDependencyPath('commons-httpclient')}"/>
   
  -    <copy todir="${maven.cactus.build.resources.dir}"
  -      file="${maven.cactus.configFile}" filtering="on">
  -      <filterset>
  -        <filter token="maven.cactus.port" value="${maven.cactus.port}"/>
  -      </filterset>
  -    </copy>
  -
  -    <!-- Copy the JUnit excluded.properties - This is needed because the
  -         the Commons logging package need to be excluded from being loaded
  -         by the special JUnit classloader. Otherwise, it fails. -->
  -    <copy todir="${maven.cactus.build.resources.dir}/junit/runner"
  -      file="${maven.cactus.testrunner.swing.excluded}"/>
  -
  -    <java classname="junit.swingui.TestRunner" fork="true" dir="${basedir}">
  -
  -      <j:forEach var="test" items="${cactusScanner.iterator()}">
  -        <jvmarg value="-Dmaven.cactus.test.${test}"/>
  -      </j:forEach>
  -      <arg line="org.apache.maven.cactus.DynamicTestAll"/>
  -
  -      <classpath>
  -        <path refid="cactus.classpath.clientside"/>
  -        <pathelement location="${plugin.dir}"/>
  -      </classpath>
  -    </java>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Generate Cactus test report (xdoc format). Run maven xdoc:transform
  -       to then transform into HTML.  By default, the test reports go into the
  -       standard test reports directory.  If you have at least one Junit Test
  -       then when you run maven site it will convert them.  Otherwise you must
  -       call cactus:generate.
  -     ========================================================================
  -  --> 
  -  <goal name="cactus:generate" 
  -    description="Generate HTML report">
  -
  -    <mkdir dir="${maven.cactus.test.reportsDirectory}"/>
  -
  -    <!-- Consolidate the reports into a single -->
  -    <!-- based on junit report plugin -->
  -    <junitreport todir="${maven.build.dir}">
  -      <fileset dir="${maven.cactus.test.reportsDirectory}">
  -        <include name="TEST-*.xml"/>
  -      </fileset>
  -    </junitreport>
  -    
  -     <doc:jsl
  -        input="${maven.build.dir}/TESTS-TestSuites.xml"
  -        output="junit-report.xml"
  -        stylesheet="${plugin.resources}/junit.jsl"
  -        omitXmlDeclaration="true"
  -        outputMode="xml"
  -        prettyPrint="true"
  -      />
  -    
  +    <taskdef name="junit"
  +      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
   
     </goal>
   
     <!--
        ========================================================================
  -       Execute all Cactus tests using the 'maven.cactus.container'
  -       variable.
  +       Execute the Cactus tests on all containers which have been defined, 
  +       i.e. which have a ${cactus.home.[container name]} property
  +       defined.
        ========================================================================
     -->
  -  <goal name="cactus:test"
  -    description="Execute all testcases">
  -
  -    <j:set var="containerHomeX" value="${maven.cactus.tomcat4x.home}X"/>
  -    <j:if test="${containerHomeX != 'X'}">
  -        <echo message="Attempting to run tomcat4x target: cactus:test-tomcat-4x"/>
  -        <attainGoal name="cactus:test-tomcat-4x"/>
  -    </j:if> 
  -    
  -    <j:set var="containerHomeX" value="${maven.cactus.resin2x.home}X"/>
  -    <j:if test="${containerHomeX != 'X'}">
  -        <echo message="Attempting to run resin2x target: cactus:test-resin-2x"/>
  -        <attainGoal name="cactus:test-resin-2x"/>
  -    </j:if>     
  +  <goal name="cactus:test" prereqs="cactus:init"
  +    description="Run all Cactus Test Cases">
   
  -    <j:set var="containerHomeX" value="${maven.cactus.weblogic7x.home}X"/>
  +    <j:set var="containerHomeX" value="${cactus.home.tomcat4x}X"/>
       <j:if test="${containerHomeX != 'X'}">
  -        <echo message="Attempting to run weblogic7x target: cactus:test-weblogin-7x"/>
  -        <attainGoal name="cactus:test-weblogic-7x"/>
  -    </j:if>         
  -    
  -  </goal>
   
  +      <echo message="Running Cactus tests on Tomcat 4.x ..."/>
   
  -  <!--
  -     ========================================================================
  -       Execute a single Cactus test case defined using the 'Dmavencactustestcase'
  -       variable.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:single"
  -    description="Execute a single test defined using the 'mavencactustestcase' variable">
  -    <j:set var="testcaseX" value="${mavencactustestcase}X"/>
  -    <j:choose>
  -      <j:when test="${testcaseX == 'X'}">
  -        <echo>
  -          You must define the test case to run via -Dmavencactustestcase=classname
  -          Example: maven -Dmavencactustestcase=MyTest cactus:single
  -        </echo>
  -      </j:when>
  -      <j:otherwise>
  -      
  -        <j:set var="maven.cactus.testrunner" value="text-single"/>
  +      <ant dir="${maven.cactus.antintegration.dir}" 
  +        target="cactus.run.tomcat4x">
  +        <reference refid="cactus.classpath"/>
  +
  +        <!-- It seems there is a bug when the properties are defined in
  +        	 plugin.properties and we need to redefine them -->
  +        <property name="cactus.target.dir" value="${cactus.target.dir}"/>
  +        <property name="cactus.src.dir" value="${cactus.src.dir}"/>
  +        <property name="cactus.port" value="${cactus.port}"/>
  +        <property name="cactus.src.includes" value="${cactus.src.includes}"/>
  +        <property name="cactus.src.excludes" value="${cactus.src.excludes}"/>
  +        <property name="cactus.context" value="${cactus.context}"/>
   
  -        <attainGoal name="cactus:test"/>
  +      </ant>
  +    </j:if> 
           
  -      </j:otherwise>
  -    </j:choose>
  -
  -  </goal>
  -  
  -  <!--
  -     ========================================================================
  -       Goals to register the Cactus test reports should to be included in the 
  -       Maven reports and produce the reports.
  -     ========================================================================
  -  --> 
  -  <goal name="maven-cactus-plugin:register">
  -    <doc:registerReport
  -      name="Cactus Test Results"
  -      link=""
  -      description="Report on the Cactus unit tests."/>
  -  </goal>
  -  
  -  <goal name="maven-cactus-plugin:report">
  -    <!-- here will be code to generate the reports.  Not sure what will 
  -         happen yet. -->  
     </goal>
   
   </project>
  
  
  
  1.1                  maven/src/plugins-build/cactus/maven.xml
  
  Index: maven.xml
  ===================================================================
  <project default="plugin:install">
  
    <!--
      =============================================================================
        Unzip the Cactus Ant Integration zip to the plugin output directory. Make 
        sure to exclude the jars which are packaged in the Ant Integration as we 
        will use the Maven auto-download feature for them (the main reason is to
        prevent putting jars in a plugin - the canonical location for jars it the
        Maven repository).
      =============================================================================
    -->
    <postGoal name="java:jar-resources">
  
      <unzip src="${maven.cactus.antintegration.zip}" 
        dest="${maven.build.dest}/plugin-resources">
        <patternset>
          <include name="**/*.*"/>
          <exclude name="**/*.jar"/>
        </patternset>
      </unzip>
  
      <!-- Rename the ant integration directory to remove the version in the
      	 name. This it to make it easy to refer to it from the plugin.jelly
      	 file -->
      <move todir="${maven.build.dest}/plugin-resources/jakarta-cactus-integration-ant">
        <fileset dir="${maven.build.dest}/plugin-resources/${maven.cactus.antintegration.name}"/>
      </move>
  
    </postGoal>
  
  </project>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org