Exclude dependency from War and create zip file of exculded dependencies

(Bilal Shah) #1

I have a application which have lot of dependencies and I want to reduce war footprint. I want to exclude these dependencies and create a .zip file of dependencies and I also want to know where to place this zip file so that when deployed to tomcat it can be picked up properly.

I tried to use providedCompile providedRuntime but its not working

(Carlo Luib-Finetti) #2
  • define a configuration for the dependencies to be excluded (“myExcludes”)
  • in the project’s dependencies define “providedCompile myExcludes”
  • in the war task say “exclude myExcludes”
  • define a task which creates the zip for the “myExludes”
  • tell Gradle the war task depends on the zip task