Issue Details (XML | Word | Printable)

Key: MPTEST-16
Type: New Feature New Feature
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Lukas Theussl
Reporter: Steffen Dingel
Votes: 2
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Test Plugin

Test Plugin should support additional classpath entries

Created: 01/Dec/03 04:45 AM   Updated: 22/Mar/06 04:51 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.8

Time Tracking:
Not Specified

File Attachments: 1. Text File ModifiedTestGoal.txt (1 kB)

Issue Links:
Duplicate
 


 Description  « Hide
When running tests, it is sometimes required to have JARs in the classpath which are not required to compile the project or the test classes (for example a JDBC driver JAR). This should not be in the dependency list in project.xml. Therefore I suggest adding a propertery "maven.test.addionalPath" to configure such JARs. This can be easily implemented by adding a line

<pathelement path="${maven.test.additionalPath}"/>

to the classpath in plugin.jelly (line 112 in the RC1 revision).



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
dion gillard added a comment - 02/Dec/03 12:39 AM
I'd much rather we add a <category> to the <dependency>

John McKeown added a comment - 03/Feb/04 07:37 AM
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.


dion gillard added a comment - 03/Feb/04 01:32 PM
Why not just add <unitTest><resources> to your project.xml?

Steffen Dingel added a comment - 04/Feb/04 03:54 AM
<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.

thierry lach added a comment - 28/Jul/05 09:51 AM
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.