Force war task to put activation.jar in WEB-INF/lib

I’m building a Java web app with Gradle 4.10.2 and Java 8. The resulting WAR file will be deployed to Tomcat running in Java 11. Java 11 does not have javax.activation so I’ll need activation-1.1.1.jar in WEB-INF/lib for my app to work. However since Java 8 includes javax.activation, the WAR does not include activation-1.1.1.jar even when it’s a compile target. How to I force my WAR to build with WEB-INF/lib/activation-1.1.1.jar?

Found it. In war, put:

  from("libs") {

Sorry. I tried this once but must have been looking at the wrong tree.

As just including is as a compile dependency. Argh! Yes, wrong tree in editor.