Hi, Jan Torben Heuer schrieb: > Wayne Fay wrote: > >> I'm not sure that I understand you entirely, but here goes.... If you >> have shared test files, you will need to create a "test-jar" artifact >> and add it as a dependency to any projects that need to use it. >> >> This is documented in a mini-guide: >> http://maven.apache.org/guides/mini/guide-attached-tests.html > > Why can't I reference test-classes in other modules? > > I have a project with two modules. module1 dependsOn module2: > <project> > <module1> > <module2> > > I can reference m2's classes from m1, but NOT m2's testclasses. That is what > I do not understand.
They are simply not part of the artifact maven creates for module2. The artifact maven creates contains just the production code (classes and resources from 'src/main/*') as no one seriously wants to have their unit tests packaged alongsite the final deliverable of the project. If you have shared testing code between two projects, just create a third module containig this shared code and declare it as a dependency in the two other modules with <scope>test</scope> or follow the guide Wanyne pointed you to and create a "test-jar" of the testing code in module2 and reference that with test scope. > Jan -Tim --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]