Seems your resource is not in the classpath.

Here is a hack for your maven.xml that should work:

<postGoal name="test:compile">
  <ant:copy file="my/foo.xml"
           tofile="${maven.build.dir}/test-classes/foo.xml">
 </ant:copy>
</postGoal>

By copying your test resources to target/test-classes you make them available
in the test classpath.


CU,
Marcel

Ciaran Treanor wrote:

I've got a unit test that needs to read a data file, i.e.
InputStream in = getClass().getResourceAsStream("foo.xml");

Within Eclipse the file is found, however when running the
test from within Maven the resource is not found (i.e. in is null).

Any ideas?

ct



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




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



Reply via email to