Derek Alexander schrieb:
> Hi, 
>
> I have a file config.xml that should be alongside its corresponding
> (TestCase) class file when the tests are run.
>
> Source is like this:
>
> src/test/java/com/example/db/config.xml
> src/test/java/com/example/db/MyTest.java       (expects to find config.xml
> in same package)
>
> I tried adding this to the surefire config in my pom:
>
> <additionalClasspathElements>
>    
> <additionalClasspathElement>src/test/java/com/example/db/config.xml</additionalClasspathElement>
> </additionalClasspathElements>
>
> But that didn't help.
>
> What I really want is for config.xml to be in:
>
> target/test-classes/com/example/db/
>
> when the test is run.
>   

Put your file in
  src/test/resources/com/example/db/config.xml
and it will automatically be copied to target/test-classes.

Alternatively, you *can* configure the maven-resources-plugin so that it
picks up files from the same dir as .java files, then excludes the .java
files from copying. But the first approach is easier, as it is the
normal maven convention.

Regards,
Simon


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

Reply via email to