gradle-tomcat-plugin
gradle-tomcat-plugin copied to clipboard
customizing WEB-INF and META-INF for exploded WAR with tomcatRun
I'm trying to port a webapp with a heavily customized ant build to gradle, and among other things it requires
- that certain resource files be copied/moved to the WEB-INF directory
- that certain files from the WEB-INF directory be copied to the META-INF directory, with filtering
With the war plugin, I'm able to do something along the lines of:
war {
webInf {
from fileTree('src/main/java').files
include "${mypattern}"
}
metaInf {
from("src/main/webapp/WEB-INF")
include "${otherpattern}"
filter { ... }
}
}
For the tomcatRun task, I can more or less duplicate this behavior by creating copy tasks that put the resources into src/main/webapp/WEB-INF/
and the filtered file into src/main/webapp/META-INF
-- but note the src
. Basically I have to pollute my source tree to get this to work.
Is there any way to add files at runtime to the exploded WAR's WEB-INF and META-INF without putting them in the source directory?
Alternatively, is there a way to point the embedded Tomcat at an exploded WAR explicitly produced e.g. by the task below?
task explodedWar(type: Copy) {
into "${buildDir}/exploded/${war.archiveName}"
with war
}
At the moment you cannot set arbitrary directories to the runtime classpath. Please see #41 for more information. Would love to see a contribution.
You should be able to create your own task of type TomcatRun
and point to a webapp directory. You will find some information to do so in the FAQ or generally the Gradle user guide.
+1 on this
Closing as issue got no traction.