On Wed, 14 May 2008 11:18:54 Wendy Smoak wrote: > On Tue, May 13, 2008 at 11:23 AM, vicki <[EMAIL PROTECTED]> wrote: > > I have a maven's subproject that runs tests against the artifacts of its > > piers subprojects. Obviously, In other words, to run my tests I need to > > create dependencies on the artifacts produced by the other subprojects. > > I run my tests with maven's "exec" plugin. All the artifacts packaged as > > jars are indeed on my classpath when I run maven exec. But dependencies > > on the artifacts packaged as wars are not resolved in such a way that > > classes directory inside these wars are put on the classpath. > > Java simply has no concept of putting a war file on the classpath. If > you have code in a war module that you need to use elsewhere, the best > idea is to move the code to a separate module that builds a jar. That > jar then becomes a dependency of your war module plus any other module > that needs it. > > If you absolutely can't move the code, the next version of the war > plugin will have the ability to deploy a classified/attached artifact > containing the code from a war module.
1) you can make the packaging type of the project jar 2) add a config for the war plugin to execute war... <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.1-alpha-1</version> <executions> <execution> <goals> <goal>war</goal> </goals> </execution> </executions> <configuration> <archiveClasses>true</archiveClasses> <classifier>application</classifier> </configuration> </plugin> 3) this gives you a jar and a war 4) you can then depend upon the jar (default) artifact to get the deps of this project and if you need to <dependency> <groupId>a.b</groupId> <artifactId>a.b.c</artifactId> <version>[1,2-!)</version> </dependency> 5) to use this war as an underlay you can depend on the project with classifier 'application' <dependency> <groupId>a.b</groupId> <artifactId>a.b.c</artifactId> <version>[1,2-!)</version> <type>war</type> </dependency> -- Michael McCallum Enterprise Engineer mailto:[EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]