I’m running into a minor problem, when applying a plugin in ‘settings.gradle’, running Gradle 1.8. When I apply it like this:
apply plugin: 'my-plugin'
buildscript {
repositories.maven { url 'http://11.22.33.44/artifactory/plugins' }
dependencies.classpath 'com.mycompany:myplugins:1.0.0'
}
I get this error:
* What went wrong:
A problem occurred evaluating settings 'main'.
> Plugin with id 'my-plugin' not found.
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating settings 'main'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:132)
at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.applySettingsScript(ScriptEvaluatingSettingsProcessor.java:64)
[...]
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'my-plugin' not found.
at org.gradle.api.internal.plugins.DefaultPluginRegistry.getTypeForId(DefaultPluginRegistry.java:82)
at org.gradle.api.internal.plugins.DefaultPluginContainer.getTypeForId(DefaultPluginContainer.java:99)
at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.groovy.scripts.DefaultScript.apply(DefaultScript.java:91)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
at settings_6m70vs06evv92jp7124mju1vbd.run(C:\Data\p4workspace\COMMON\core.3\settings.gradle:1)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 29 more
The ‘META-INF/gradle-plugins/my-plugin.properties’ file seems to be fine, and when I use the class name, it works:
apply plugin: com.mycompany.MyPlugin
In the same Jar I have a couple of plugins that are applied to ‘Project’, and all of them work as expected.