jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin West <mar...@objectgizmos.com>
Subject samples servlet test classes
Date Mon, 22 Sep 2008 20:53:31 GMT

Another observation, all the test classes are in src/main/java. You can
move them to the standard location, then remove the testSource and
testClass from surefire plugin configuration and add the following
plugin to the pom at the start of the plugins section.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-antrun-plugin</artifactId>
  <executions>
    <execution>
     <id>test-compile</id>
     <phase>test-compile</phase>
     <configuration>
       <tasks>
        <property name="finalName"
          value="${pom.build.finalName}" />
	<ant
antfile="${basedir}/build-antrun.xml">							    <target
name="copy-test-classes" />
        </ant>
      </tasks>
    </configuration>
    <goals>
      <goal>run</goal>
    </goals>
   </execution>
  </executions>
  <dependencies>
    <dependency>
     <groupId>ant</groupId>
     <artifactId>ant-jsch</artifactId>
     <version>1.6.5</version>
    </dependency>
    <dependency>
     <groupId>jsch</groupId>
     <artifactId>jsch</artifactId>
     <version>0.1.25</version>
    </dependency>
  </dependencies>
</plugin>

then create build-antrun.xml ...

<project name="antrun" default="default">
  <target name="default">
    <echo message="default"/>
  </target>
  <target name="copy-test-classes">
    <copy todir="target/${finalName}/WEB-INF/classes">
     <fileset dir="target/test-classes"/>
    </copy>
  </target>	
</project>


-- 
regards 
   Martin West



Mime
View raw message