On 23/03/2011, at 5:57 AM, Peter Niederwieser wrote:
> 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")
> }
Or, if the commons project uses the war plugin, you can do something like this:
war {
with project(':commons').war
}
This will pick up the convention stuff above, plus any customisations done to
the contents of the war in the commons project.
>
> --
> 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
>
>
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
Co-Founder and VP of Engineering, Gradleware Inc. - Gradle Training, Support,
Consulting
http://www.gradleware.com