Building each war, each time.
So, my solution to inheriting the dependencies from the one subproject to the
dependent project with an explicit compile project(':'other_subproject), was to
extend configurations, and obviously still add that configuration to the
classpath portion of the war task.
configurations
{
weblogicAdditionalLibs.extendsFrom( \
project(':other_subproject').configurations.weblogicAdditionalLibs)
}
There might be a better way to wire up configurations, but this allowed me to
add dependencies to this like named configuration within other_subproject that
got pulled into the local configuration.
-Spencer
--- On Wed, 6/9/10, Jason Porter <[email protected]> wrote:
From: Jason Porter <[email protected]>
Subject: Re: [gradle-user] Configurations behavior and war files
To: [email protected]
Date: Wednesday, June 9, 2010, 5:02 PM
Are you building each war every time, or one war at different runs? I'd done
something like this with 0.8, basically the same way you had been doing it, and
also building different wars with different builds. Both worked, but something
may have changed with 0.9.
On Tue, Jun 8, 2010 at 12:05, Spencer Allain <[email protected]> wrote:
So, I'm attempting to build different war files; one for each type of
deployable container (jetty, weblogic, glassfish, jboss, etc.). This is
necessary, as some app servers need additional files, and others need them
excluded.
subprojects
{
configurations {
weblogicAdditionalLibs
jettyAdditionalLibs
}
}
At one point it worked with
task warWeblogic(type: War) {
classpath configurations.weblogicAdditionalLibs
}
when weblogicAdditionalLibs dependencies were added within a different
subproject that this war-constructing subproject depends upon.
Now each subproject truly does get a separate set of configuration objects that
are not shared (probably supposed to be the behavior all along).
Technically this is a "conditional" dependency. Some
war files need these dependencies at runtime, and others do not (and in fact,
cannot have them or they fail).
Is there a recommended way to do this, since my previous attempt no longer
works?
-Spencer
--
Jason Porter
Software Engineer
Open Source Advocate
PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu