This has come up several times on this list, as recently as a week
ago, and people have discussed strategies for dealing with it etc. One
thread in particular you will want to read is:
date Mar 5, 2008 5:07 PM
subject java.class.path and the surefire-plugin
For more info, go to Nabble.com and search the list archives for
java.class.path.
Wayne
On 3/13/08, ben short <[EMAIL PROTECTED]> wrote:
> 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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]