I'd try to tackle it this way:

Have a third project, say 'commons', that produces a Jar containing the
shared classes and also has a webapp directory. The two web projects depend
on the 'commons' project. This solves the class sharing part. To include the
webapp resources, just configure the web projects' war tasks along the lines
of:

war {
  from project(":commons").fileTree("src/main/webapp")
}

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradleware
http://www.gradleware.com
Creator, Spock Framework
http://spockframework.org



Sten Roger Sandvik-2 wrote:
> 
> Well, Maven uses something they call WebApp overlays. It's not great, but
> it
> works. At least for small projects :-) What I want Gradle to do is the
> following:
> 
>   * Common webapp project builds as usual (no magic stuff here)
>   * Specialized webapp has sourceSets to itself and to the common webapp.
>   * Specialized webapp has dependencies from common webapp and additional
> dependencies.
>   * Specialized webapp adds common webapp compiled classes/resources and
> it's own compiled classes/resources.
> 
> Anyone have done something like this?
> 

--
View this message in context: 
http://gradle.1045684.n5.nabble.com/War-dependency-to-another-war-tp4257270p4257485.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to