How do I exclude specific transitive dependencies of something I depend on?

Further investigation, now I can’t even use the syntax which was originally suggested.

  compile('org.jruby:jruby-core:9.0.5.0') {
    exclude('com.martiansoftware:nailgun-server')
  }

Gives:

> Could not find method compile() for arguments [org.jruby:jruby-core:9.0.5.0, build_7sitauikbgnylchfbg4j698l1$_run_closure1$_closure3@2564410b] on project ':scripting-impl'.

If I remove the closure:

  compile('org.jruby:jruby-core:9.0.5.0')

Now the build works fine… so it’s like it can’t find the overload which takes a Closure? :confused: