Hi Jefferson,
your dependency isn't added to the war because you declared it as providedCompile and runtime dependency. You should avoid to declare the same dependency for two scopes. Behind the scenes, gradle filters every dependency that is declared as providedCompile dependency when the war is created. Since your runtime dependency is exactly the same as your providedCompile dependency. Normally there is no reason for adding your dependency as providedCompile and Runtime. Instead you should just add it as "compile" dependency.

regards,
René



--
--
Rene Groeschke
@breskeby

Principal Engineer,
Gradleware Inc. - Gradle Training, Support, Consulting
rene.groesc...@gradleware.com
http://gradleware.com 
 
14. Februar 2012 14:39
Hi guys, I have a question related to the War plugin.

My war project depends on another (path: ':bp.jars', configuration: 'search') at compile time.
It also needs the jar files on the lib dir of generated war file.

The documentation says "All the dependencies of the runtime configuration are copied to WEB-INF/lib".
But I tried the following, without success (the jars were not been included into the generated war file):

dependencies {
providedCompile project(path: ':bp.jars', configuration: 'search')
runtime project(path: ':bp.jars', configuration: 'search')
}

After many tries, It is now working when I use:

dependencies {
compile project(path: ':bp.jars', configuration: 'search')
}

Why the jars are not included when I use runtime configuration, but are included when I use compile configuration?

Thanks a lot,

Jefferson



Reply via email to