Thanks Wayne, really useful explanations. I already had googled a bit about this but, as always, one cannot expect to find good examples or practices out there and I have a high respect for this list opinions, specially about "the maven way" which I see now again and again ends up always with less headaches in the long-term.

Em 26-05-2011 16:40, Wayne Fay escreveu:
The thing is, not even the classes in the WAR show up in the test module.
Are WAR-type modules never supossed to be added as dependencies? I read

Try packaging a utility class file in a War, and then run it from
"java -cp blah.war YourClass." War files are not understood by the
JVM, only Jar files are valid classfile containers. For this reason,
it is not really valid to have a War module as a dependency except in
an Ear module (or perhaps another War module where you're using
overlays).

somewhere that transitive dependencies don't work for WARs, does it mean the
only way to go is have nearly-empty WARs with all classes in other modules,
on which the WAR depends?

This is the "correct" way to set things up. Put your class files in
one or more Jar modules and then depend on those modules in your War
project. Localize unit and integration testing within the Jar module
if possible.

What is the recommended aproach to organize integration testing in a maven
multi-module webapp project?

You can still do integration testing with your War file. But this
should mean deploying the War file to a container and running some
integration testing via Cactus, Selenium or perhaps failsafe.

Here's some more info:
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
http://andrewmccall.com/2008/09/integration-testing-in-maven-with-maven-cargo-httpunit-and-selenium
and you'll find more links on Google with the terms "maven war
integration testing."

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to