You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jakub Pawlowicz <co...@jakubpawlowicz.com> on 2006/07/14 10:25:49 UTC
Problem with classpath when running tests in multi module projects
Hi,
I've been stuck with a problem when I was trying to build a multimodule
application with Maven (2.0.4). I've got a following project structure (you
may find this project in the attachment):
Classpath-Test
- Module1
- Module2
Module1 is a jar module which has an applicationContext.xml (Spring context)
in the src/main/resources. This context defines one bean, which class is in
the sources directory.
Module2 is also a jar module, which has the Module1 as a dependency. There is
only one test case, which tries to load applicationContext.xml from the
Module1 and to get a bean instance from it.
So if I run 'mvn test' from the project's root directory (Classpath-Test)
everything works fine.
However if I run 'mvn install' from it then I'm getting a "No bean named
'customBean' is defined" message, which simply means that
applicationContext.xml could not be found in the classpath and my 'customBean'
could not be loaded.
What's more, if I execute this test case from Eclipse it fails as well.
Any thoughts?
Regards,
Jakub