We are working on migrating to Gradle from Maven. Unfortunately, we still have a couple of military issues that we have to deal with.
As a job, I am trying to copy the contents of one war file to another.
This is what I have so far:
task overlayWars (dependsOn: war) << { // Get the source war files to copy the contents from... def dependencyWars = configurations.runtime.filter { it.name.endsWith ('.war') } dependencyWars.each { dependentWar -> // Get the products, ie the target war file... war.outputs.files.each { product -> println "Copying $dependentWar contents into $product" copy { from { zipTree (dependentWar) } into { zipTree (product)} // this seems to be the problem include 'WEB-INF/classes/**/*.class' include 'WEB-INF/jsp/**/*.jsp' } } } }
When into { zipTree (product)} is a file (for example, file ('tmp/whatever') ), this works fine. When specifying another zip file (target war file), it fails with an error:
Converting the org.gradle.api.internal.file.collections.FileTreeAdapter class to use files The toString () method is deprecated and must be removed in Gradle 2.0. Use java.io.File, java.lang.String, java.net.URL or java.net.URI.
If anyone has any suggestions on this, or the best way to โoverlayโ military files, I would really appreciate it!
source share