Hello,

I just downloaded maven and played a little bit with it.
I have the following problem (maven 2.0.6):

project structure

.
|
src
|  main
|   |
|   java
|  test
|    java
|     |src
|     |resources
|       |myconfig.xml
pom.xml

When I run mvn test, everything works fine, sources are compiled, resources are 
copied into test-classes etc.
When tests run, tests assumes that configuration file "config.xml" in current directory, which is "." and resource file went to ./test-classes/config.xml.

I don't understand why current directory when running tests is not "./test-classes/". What should I do? How to tell maven which directory is current for runing tests? Or should I use another method to load configuration file?

Thank you,
Cristian.


Here is my pom.xml


<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>ro.romanescu.eximius</groupId>
  <artifactId>eximius</artifactId>
  <packaging>jar</packaging>
  <version>1.0</version>
  <name>eximius</name>
  <url>http://maven.apache.org</url>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.3.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.12</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
      <version>1.6.1</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>jaxen</groupId>
      <artifactId>jaxen</artifactId>
      <version>1.1</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to