I'm working on a multi-module ear project, which contains two wars and a jar
that we build which both rely on. When I made the common module a
provideCompile dependency then it's jars were also excluded from the war
lib, but these are needed at runtime. 

I am using a recent 0.9 snapshot of gradle and I found that none of the
various 0.8 documented methods for adding extra libs to seem to not be
supported anymore: 
war {
    fileSet(dir: file('src/rootContent')) // adds a file-set to the root of
the archive
    webInf(dir: file('src/additionalWebInf')) // adds a file-set to the
WEB-INF dir.
    additionalLibs(dir: file('additionalLibs')) // adds a file-set to the
WEB-INF/lib dir.
    libConfigurations('moreLibs') // adds a configuration to the WEB-INF/lib
dir.
}

Instead I created a configuration for the the required libs that were being
excluded via the dependent project and included them like this:

    from(configurations.warLib){   // adds the warLib configuration file-set
to the WEB-INF/lib directory of the archive
      into 'WEB-INF/lib'
    }


The only thing I don't like about this is listing those jars twice, both in
the compile for the war project and also my custom warLib configuration. 

Is this the recommended 0.9 approach ? 



-- 
View this message in context: 
http://old.nabble.com/adding-jars-to-the-WEB-INF-lib-of-a-war-gradle-0.9-tp27755915p27755915.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