|
[
Permlink
| « Hide
]
dion gillard added a comment - 02/Dec/03 12:39 AM
I'd much rather we add a <category> to the <dependency>
I have encountered a similar problem. I am working on a project that loads runtime configuration files using the system ClassLoader. This requires the folder containing the configuration files to be in the classpath. When I run the unit tests through Maven I would like to include the folder in the classpath for the junit task so that the classes being tested have access to the configuration files.
I assumed this could be resolved by passing JVM arguements to the Test Plugin using the 'maven.junit.jvmargs' property. However if this property contains entries for -classpath or -cp they will be effectively ignored because a seperate classpath is added to the junit task which will override both of these. If the goals in the Test plugin were modified to recognise classpath/cp entries specified as JVM arguments then additional pathelements could be included in junit task by simply changing the project.properties file. See attached for an example of how this could be done. Why not just add <unitTest><resources> to your project.xml?
<unitTest><resources> does not allow adding JARs to the classpath. It works when we unpack the JARs and add the directories to <unitTest><resources>, but that is not a very convenient solution.
I think it would be more useful to allow dependencies to declare which classpaths they should be used in (default would be in all). Then the pom would provide the configuration.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||