Exclude plugin syntax

i want to try to do something like this

project.plugins.withType(JavaPlugin) {
  exclude = ["com.mycompany.bla.javascriptPlugin"]
  project.plugins.apply(GroovydocJarPlugin)
}

my issue is with the fact that all the good stuff is based on the Java plugin. So i have plugins that have nothing to do with Java, but need the java plugin to get things like sourcesets and such. But, things like a groovydocJar task has no place on a Javascript plugin and just wastes time/effort during a javascript build. So i would like to exclude it on create. And i have to do it by classname to avoid a circular dependency. Not ideal, i know, but its what i have right this moment. I will refactor it out later.

Ive tried to do an exclude before, but i hit a concurrency issue. It only works if the javascript has already been applied, if the JS plugin is applied afterwards, the simple solution doesn’t work.