Use prebuilt jar with JvmLibrarySpec

I’m attempting to build a Java library with the new JvmLibrarySpec configuration. How can I add a dependency on a local jar file?

I’ve tried setting the classpath for the JavaCompile task, and that didn’t seem to work. Not sure if there is a specific syntax for this documented - the docs only seem to cover Maven artifacts.