Step one completed -- the resources are being built/copied correctly.

I used a little JUnit test to exercise the difference between using
ClassLoader.getSystemResourceAsStream() and Kierans suggestion above.

In Eclipse, both tests pass, but in Maven, the ClassLoader method fails, as
you're observing. My only explanation for this is some class loader issue
within Maven, Plexus, etc.

So, follow Kierans suggestion, and don't forget to add a leading '/' to your
resource path when using this.getClass().getResourceAsStream() as your
properties file is in the default/root package.

HTH,
Doug

On 6/1/06, Martin Aspeli <[EMAIL PROTECTED]> wrote:



Edelson, Justin wrote:
>
> Depending on how much flexability you have to move files around, I would
> suggest moving these property and xml files to src/test/resources and
> removing the testResources block entirely.
>

Yeah, I did that, actually; however, the maven testrunner still can't find
the file at runtime.
--
View this message in context:
http://www.nabble.com/Referencing+.properties+files+in+the+CLASSPATH+in+test-t1717149.html#a4664514
Sent from the Maven - Users forum at Nabble.com.


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


Reply via email to