On Mon, Nov 30, 2009 at 07:10, Erik B <[email protected]> wrote:
Apologies if this solution already exists in the user forum.
Problem:
Two projects exists, "common" and "webapp". Common uses "java" plugin,
webapp uses "webapp" plugin.
"Webapp" has "common" as a subproject and the dependencies in "common"
includes a jar that we do not want to distribute with the webapp. A simple
example would be the javaee.jar which already exists in a web container that
will host the webapp.
The projects are only using file dependencies from a separate directory.
Solution:
The solution is not clearly described in the documentation and took me quite
some time to figure out but was dead simple once i realised. Example from
"webapp" project build.gradle:
---------------------------------------------
usePlugin("war")
...
dependencies {
//Includes javaee.jar. providedCompile does not exist as an option
in plugin "java".
//We can therefore not exclude it from there.
compile project(":common");
//Excludes compile time file that already is part of runtime env
providedCompile files("${repo}/references/javaee.jar")
}
---------------------------------------------
Suggestion:
Include in the dependencies section in the user guide, which by the way is
an excellent documentation. Motivation for inclusion is that this is such a
common use case that almost anyone building a webapp will encounter it.
--
View this message in context:
http://old.nabble.com/Suggestion-for-improved-documentation-regarding-dependencies-tp26575354p26575354.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
I believe the providedCompile and providedRuntime configurations will be moved up into the Java plugin. I'm not sure if this will be in 0.9 or 0.10 however.
-- Jason Porter Real Programmers think better when playing Adventure or Rogue. PGP key id: 926CCFF5 PGP fingerprint: 64C2 C078 13A9 5B23 7738 F7E5 1046 C39B 926C CFF5 PGP key available at: keyserver.net, pgp.mit.edu
signature.asc
Description: OpenPGP digital signature
