I just discovered there is a "<sourceDirectory>" element as part of the "<build>" tag. So in my test folder, I made the <sourceDirectory> my webapp's java folder, where the .java files are contained.
Is this the conventional way of doing it? That prevents me from having to make a JAR file out of my WAR's classes, but maybe I'm misunderstanding the purpose of the <sourceDirectory> element. Thanks, - Dave Wendy Smoak-3 wrote: > > On Tue, Dec 1, 2009 at 8:10 AM, laredotornado <laredotorn...@gmail.com> > wrote: > >> I'm using Maven 2.2. I think I read somewhere that you cannot have a WAR >> as >> a dependency because maven doesn't know how to read the WEB-INF/classes >> directory. > > This isn't Maven related, it's a Java thing. Try compiling code at > the command line with a war on the classpath -- it won't work. > > If something else depends on the classes in your war, then those > classes probably deserve to be in a separate module which creates a > jar. Then both your war and the other project can depend on this jar. > > You might also be interested in the 'archiveClasses' parameter of the > war plugin, which will make it create a jar instead of using > WEB-INF/classes. > http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html > > -- > Wendy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > > -- View this message in context: http://old.nabble.com/How-do-you-include-classes-from-a-WAR-as-a-dependency--tp26593382p26594232.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org