maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wong (JIRA)" <>
Subject [jira] Commented: (MPTEST-13) Order of classpath entries should be changed
Date Fri, 01 Feb 2008 01:18:58 GMT


David Wong commented on MPTEST-13:


Has this issue been fixed?  When I do mvn -X to see the classpath when running an unit test;
the build path is still before the test path.  I'm running Maven 4.2.

[DEBUG] Test Classpath :
[DEBUG]   W:\data\ejb\target\classes
[DEBUG]   W:\data\ejb\target\test-classes
[DEBUG]   ...

Shouldn't test path be come before the build path?


> Order of classpath entries should be changed
> --------------------------------------------
>                 Key: MPTEST-13
>                 URL:
>             Project: Maven 1.x Test Plugin
>          Issue Type: Bug
>            Reporter: Michal Maczka
>         Attachments: test-diff.txt,
> Behavior of my application is controlled through set of configuration files(like log4j.propertrties).
> I want to control behavior of my application differently for the test
> environment and differently for the production environment.
> The problem is that currently in maven the "production" resources are preceding the test
resources in the classpath
> and [test] plugin is always taking  them in first order.
> I am including short example showing where is the problem.
> Basically in  it I have two files: one in
> 'test-resources', second in 'resources' directory.
> This example shows that the the one kept in test-resources is never used and it is not
possible  to easily control
> the "test environment" when it is overlapping with "production'
> environment".
> As a result of this program the output of log statements is always written to production.log.
Test resources are containing file which configures the log system for tests
and directs log statements to a file test.log. This example shows that 
> this file is never created.
> Other problem here is: if any of the dependencies in the classpath contains 
>  this file will even preceeds the in the classpath.
> So the best solution in my opinion will be to have followiing order of entries in the
class path:
> <classpath>
>    <pathelement location="${maven.test.dest}"/>
>    <path refid="maven.dependency.classpath"/>
>    <pathelement location="${}"/>
>    <pathelement path="${plugin.getDependencyPath('junit')}"/>
> </classpath>
> The problem is generic and not only typical to log4j. The same applies for example to
> Michal Maczka

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message