Hello Gerold
That is probably due to the fact that log4j will start looking in the
current working directory.
You could always change the working directory of the surefire-plugin to the
location of your choice and find out..
In your case, this will probably be "target/test-classes"..
Here's a snippet:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<workingDirectory>${project.build.directory
}/test-classes</workingDirectory>
</configuration>
</plugin>
</plugins>
</build>
Good luck..
Jo
On 2/24/07, gerold kathan <[EMAIL PROTECTED]> wrote:
hi, i have the following "issue":
* within my code i am referring to log4j configuration sitting at
static
{
DOMConfigurator.configure("log4j.xml");
logger = Logger.getLogger(AppTest.class);
}
* so it should find the config under the root of project
* OK - i learned to put the stuff under src/main/config/ and tell pom.xml
via <testResources> entry that he has to include the log4j.xml
<testResources>
<testResource>
<directory>src/test/config</directory>
<includes>
<include>log4j.xml</include>
</includes>
</testResource>
</testResources>
* OK - when i run "mvn test" everything works as expected => the log4j.xml
is copied under target/test-classes/ (which in fact i assume as being the
root in context of the test runner
* BUT - log4j complains that it cannot find the config file because he is
looking under the "general root" (=$basedir) of the project (= the
directory
where the pom.xml sits) and NOT within the target/test-classes/ context
any hints on that ?
greetz from vienna,
gerold.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]