Hi,
I have been trying to figure out why the maven compiler is not
compiling my test classes and would appreciate some help.
Every time I try to do a mvn clean test-compile, I will get the
"Nothing to compile" when the test classes specified in
<testSourceDirectory>src/test</testSourceDirectory> is not touched and
the target/test-classes directory is empty except with the testResources
I specified. It also didn't try to compile the Mock classes I
generated. Here is the console output.
[INFO] Executed tasks
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[WARNING] POM for 'commons-codec:commons-codec:pom:1.3' is invalid. It
will be i
gnored for artifact resolution. Reason: Failed to validate POM
[WARNING] POM for 'commons-io:commons-io:pom:1.0' is invalid. It will be
ignored
for artifact resolution. Reason: Failed to validate POM
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date.
The following is the build section of my pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.4</compilerVersion>
<source>1.4</source>
<target>1.4</target>
<testIncludes>
<testInclude
implementation="java.lang.String">src/test/**/*.java</testInclude>
<testInclude
implementation="java.lang.String">target/generated-test-src/mocked/**/*.
java</testInclude>
</testIncludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-test-sources</phase>
<configuration>
<tasks>
<path
id="mockcreator.classpath">
<path
refid="maven.plugin.classpath"/>
<path
refid="maven.compile.classpath"/>
</path>
<java fork="yes"
classname="de.abstrakt.tools.codegeneration.file.MockCreatorFile"
failonerror="true" classpathref="mockcreator.classpath">
<!--<arg
line="-o ${project.build.outputDirectory}/generated-test-src/mocked"/>
-->
<arg
line="-o target/generated-test-src/mocked"/>
<arg
value="someClass"/>
</java>
<!--
Place any ant task here. You can add
anything
you can add between <target> and
</target> in a
build.xml.
-->
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
</includes>
<excludes>
<exclude>**/OMLoadTest.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-test-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-test-src/mocked</source>
<source>src/test</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<sourceDirectory>src/java</sourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<outputDirectory>target/classes</outputDirectory>
<testOutputDirectory>target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>conf/templates</directory>
<includes>
<include>config.properties</include>
<include>hibernate.cfg.xml</include>
</includes>
<filtering>true</filtering>
<targetPath>../resources</targetPath>
</resource>
</resources>
<testResources>
<testResource>
<directory>conf/test</directory>
<includes>
<include>config.properties</include>
<include>hibernate.cfg.xml</include>
</includes>
<filtering>false</filtering>
</testResource>
</testResources>
</build>
What have I done wrong? Any help is greatly appreciated.
Thanks,
Dennis Ho
Senior Java Developer
PaymentOne
. : Office - 408.362.4237
. : www.paymentone.com . : [EMAIL PROTECTED]
. : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . : .
. : Connecting Digital Merchants and Network Operators
. : Named One of Forbes "Top Ten to Watch in 2005"