Quoting Aaron Freeman <[EMAIL PROTECTED]>:

> One of our projects uses some mock objects for running some JUnit
> tests. These objects were put in the appropriate packages under the
> src/test folder in one of the sub-modules. Now we want to use these
> mock objects in the JUnit tests of one of the other sub-modules.
> However, when Maven tries to compile the test classes in the second
> sub-module it says it can't find the mock objects. I assume this is
> because you can't reference classes in the src/test section of another
> project. Is this true?

Correct.  Artifacts don't contain test classes and resources.


> Is there any way to change this? Or should we
> pull all the mock objects into a separate sub-module and have both the
> other modules reference them there?

That is the recommended approach - create a "Test Framework" project and put the
common test classes in the src/main area, not the src/test (if your dir
structure matches the Maven defaults).


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

Reply via email to