Hi,

I am adding some Unit tests to a legacy application before I make any changes.

As part of the tests I start the application. When the application
starts it scans all the classes on the classpath. Unfortunately the
only jar on the classpath is the classworlds.jar due to the way maven
handles dependencies. The application will use a system property
called java.class.path if present. So I have configured the surefire
plugin as shown below.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.3</version>
                <configuration>

<workingDirectory>${basedir}\target\test-classes</workingDirectory>
                    <systemProperties>
                        <property>
                            <name>java.class.path</name>
                            <value>${project.testClasspathElements}</value>
                        </property>
                    </systemProperties>
                    <includes>
                        <include>nexusalpha/**/*Tests*</include>
                    </includes>
                    <excludes>

<exclude>nexusalpha/jaf2/services/webservice/AlertServerWebServiceTests*.java</exclude>
                    </excludes>
                    <reportFormat>brief</reportFormat>
                    <useFile>false</useFile>
                    <skip>false</skip>
                </configuration>
            </plugin>

Unfortunately when i run the tests the application prints that the
value for the system property java.class.path is
${project.testClasspathElements}. So it seems that maven is not
filtering this property correctly.

As a quick test i added ${project.testClasspathElements} to the
workingDirectory element I see that maven complains that the
workingDirectory is not valid and on inspection i see that the
projects dependencies are listed correctly.

Can anyone help me out with this? I'm using maven 2.0.8.

Regards

Ben Short

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to