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


Reply via email to