jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 1.x Test Plugin
  • MPTEST-16

Test Plugin should support additional classpath entries

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: None
  • Fix Version/s: 1.8
  • Labels:
    None

Description

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).

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    ModifiedTestGoal.txt
    03/Feb/04 7:37 AM
    1 kB
    John McKeown

Issue Links

is duplicated by

Improvement - An improvement or enhancement to an existing feature or task. MPTEST-47 It should be possible to add additional elements to the test classpath

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
dion gillard added a comment - 02/Dec/03 12:39 AM

I'd much rather we add a <category> to the <dependency>

Show
dion gillard added a comment - 02/Dec/03 12:39 AM I'd much rather we add a <category> to the <dependency>
Hide
Permalink
John McKeown added a comment - 03/Feb/04 7: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.

Show
John McKeown added a comment - 03/Feb/04 7: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.
Hide
Permalink
dion gillard added a comment - 03/Feb/04 1:32 PM

Why not just add <unitTest><resources> to your project.xml?

Show
dion gillard added a comment - 03/Feb/04 1:32 PM Why not just add <unitTest><resources> to your project.xml?
Hide
Permalink
Steffen Dingel added a comment - 04/Feb/04 3: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.

Show
Steffen Dingel added a comment - 04/Feb/04 3: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.
Hide
Permalink
thierry lach added a comment - 28/Jul/05 9: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.

Show
thierry lach added a comment - 28/Jul/05 9: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.

People

  • Assignee:
    Lukas Theussl
    Reporter:
    Steffen Dingel
Vote (2)
Watch (5)

Dates

  • Created:
    01/Dec/03 4:45 AM
    Updated:
    22/Mar/06 4:51 PM
    Resolved:
    22/Mar/06 4:51 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.