Hello,

I'm a newbie when it comes to bundling wars.  I figured Gradle could help
with this.  Oh, I'm also a newbie Gradle user.

I have a WAR project that depends on a number of other projects -the jars
produced by the sub-projects.  This means that my WAR project has a compile
time dependency on my sub projects.  Obviously, when I create my WAR, it
will need to bundle the runtime dependencies of my sub projects in the WAR. 
This is where I'm having a problem.  All of the runtime dependencies of the
sub-projects live in the 'lib' folder of the each sub-project.  I noticed
that Gradle only looks in the lib folder (repository) of the WAR when trying
to find these run-time dependencies.  What's the best way to solve this
problem?

-  Is it best practice for the WAR project to include all of the run-time
dependencies of the sub-projects in its own 'lib' folder?  This doesn't feel
right
- Is it possible to have Gradle look in the 'lib' folder of each sub-project
for the appropriate transitive jars?  If so, is there an automatic mechanism
for this?  If not, is there a generic way to refer to the repository
location of my sub-projects?

I'm not using remote repositories for any of these projects.  It's all
stored locally.  I tried adding 'dependsOnChildren()' in my ":Web
Application" project, but it didn't help.

Thanks for any help you all might provide.  I'm really enjoying Gradle so
far.

Andrew

-------------------------

Here's an example of my configuration...

Folders:

/Projects
   /Sub Project
      /lib
   /Web Application
      /lib
   settings.gradle
   build.gradle


In settings.gradle: include 'Sub Project', 'Web Application'

In build.gradle:

subprojects {
    usePlugin('java')
    version = '1.0'
    sourceCompatibility = 1.6
    targetCompatiblity = 1.6
}

project(":Sub Project") {
        repositories {
                flatDir name: 'localRepositories', dirs: ["${projectDir}/lib"]
        }
        dependencies {
                compile group: 'junit', name: 'junit', version: '3.8.2'
                runtime name: 'dbunit', version: '2.0'

        }
}

project(":Web Project") {
        usePlugin('war')
        repositories {
                flatDir name: 'localRepositories', dirs: 
["${projectDir}/WEB-INF/lib"]
        }
        dependencies {
                compile project(":Sub Project")
        }
}
--------------------------
It's only looking in "${projectDir}/WEB-INF/lib" for the transitive runtime
jars when bundling the WAR.  In this example, the runtime jar dbunit only
lives in '/Projects/Sub Project/lib'

-- 
View this message in context: 
http://www.nabble.com/Bundling-transitive-jars-in-WAR-tp25862878p25862878.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