maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <wsm...@gmail.com>
Subject Re: How do you include classes from a WAR as a dependency?
Date Tue, 01 Dec 2009 15:52:23 GMT
On Tue, Dec 1, 2009 at 8:10 AM, laredotornado <laredotornado@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-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message