Re: [picocontainer-dev] [NanoContainer] Maven 2 Multiproject Build Error?
Mauro Talevi <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Michael Rimov wrote:
>
> Followup -- Just did a Clean install on a Powerbook G4 running OS X 10.3
>
> trunk/nanocontainer$ mvn clean test
>
> Same results, test case failure in ScriptedContainerBuilderFactoryTestCase
>
> Here's the portion that is failing the test case:
>
> ScriptedContainerBuilderFactoryTestCase: 49
>
> File resource = new
> File("src/test/org/nanocontainer/nanocontainer.groovy");
> assertNotNull("Could not find script resource '+ TEST_SCRIPT_PATH +
> '.", resource);
>
>
> The problem is that using mvn test, the current working directory is always:
>
> trunk/nanocontainer
>
> instead of:
>
> trunk/nanocontainer/container
>
> So the code that depends on the current working directory be
> trunk/nanocontainer/container fails.
>
Yep - I can reproduce it as well now.
This behaviour must have changed in m2.
In order to reference absolute paths we seem to need to specify the path from top-level dir, ie
File resource = new File("container/src/test/org/nanocontainer/nanocontainer.groovy");
which is not in itself too bad a thing (at present test fails within IDE for same reason), but
it would allow tests to be passed only from top-level.
Else - we would need to copy the resource to some tmp dir and get it from there.
I'll look into what is the recommended way in m2 to reference absolute paths in component projects.
Cheers