Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find method defaultDependencies() #107

Closed
fritzrichter opened this issue Sep 14, 2015 · 11 comments
Closed

Could not find method defaultDependencies() #107

fritzrichter opened this issue Sep 14, 2015 · 11 comments

Comments

@fritzrichter
Copy link

My build is showing the following error, I don't know where this error comes from.

fritz@fritz-macbook:amp-frontend>./gradlew buildImage

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/fritz/dev/projects/amp-frontend/build.gradle' line: 111

* What went wrong:
A problem occurred evaluating root project 'amp-frontend'.
> Could not find method defaultDependencies() for arguments [com.bmuschko.gradle.docker.DockerRemoteApiPlugin$_configureAbstractDockerTask_closure1_closure3@4bf80c29] on configuration ':dockerJava'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.838 secs
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'amp-frontend'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:154)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:59)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:492)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:86)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:129)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:169)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.api.internal.MissingMethodException: Could not find method defaultDependencies() for arguments [com.bmuschko.gradle.docker.DockerRemoteApiPlugin$_configureAbstractDockerTask_closure1_closure3@32d418a9] on configuration ':dockerJava'.
    at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68)
    at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:172)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.invokeMethod(Unknown Source)
    at com.bmuschko.gradle.docker.DockerRemoteApiPlugin$_configureAbstractDockerTask_closure1.doCall(DockerRemoteApiPlugin.groovy:54)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:110)
    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:488)
    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:58)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
    at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:201)
    at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
    at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:164)
    at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
    at org.gradle.api.internal.DefaultNamedDomainObjectCollection.add(DefaultNamedDomainObjectCollection.java:71)
    at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:65)
    at org.gradle.api.internal.project.AbstractProject.task(AbstractProject.java:867)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:225)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:129)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
    at build_kvjle8e40hqo52i7fxmea6s4.run(/Users/fritz/dev/projects/amp-frontend/build.gradle:111)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 35 more
@fritzrichter
Copy link
Author

I solved it, it was an old gradle version. Thanks anyway

@miffels
Copy link

miffels commented Jan 12, 2016

@fritzrichter Would be great if you could share some more insights. What version are you using? I am currently facing the same issue. What gradle version fixed it for you? My project is currently using gradle 2.3.

Alright, curiously enough Google tells me there are more similar issues, and the solution can be found here.

In a nutshell, use gradle 2.5+.

@bmuschko
Copy link
Owner

@miffels Please set README.md of the plugin: "This plugin requires Gradle >= 2.5 to work properly."

@miffels
Copy link

miffels commented Jan 12, 2016

@bmuschko I was following a guide describing how to package Grails apps as Docker images, and the author failed to mention this crucial bit. Please bear with me and other people coming from there not knowing this, and not immediately reading through the READMEs of all referenced software. You try it, assume it should work. You see the error, google for it, and find this issue as the top-ranked result. Then you find that somehow the version might be the problem, but no one bothers to mention which one you actually need. I only meant to help future Googlers.

Best,
Michael

@bmuschko
Copy link
Owner

@miffels OK, thanks for the link. I wasn't aware of this blog post.

@st9x3st9
Copy link

I am using gradle version 2.11 and I am getting this error. Does this plugin only fit between gradle >= 2.5 and gradle <= 2.6? or something like that.

@cdancy
Copy link
Collaborator

cdancy commented Mar 21, 2016

@st9x3st9 should work with 2.11. We are actually using it with 2.12 here and have not seen any issues. Have you tried other versions of gradle and found them to work?

@st9x3st9
Copy link

I was using an old gradlew file instead of just using gradle which was version 2.11

@cdancy
Copy link
Collaborator

cdancy commented Mar 21, 2016

@st9x3st9 What version did the old gradlew use?

@st9x3st9
Copy link

Not sure how do I check that? Also how do I update the gradlew file to use the new version of 2.11?

@cdancy
Copy link
Collaborator

cdancy commented Mar 21, 2016

There should be a folder titled gradle that is sitting side-by-side with your gradlew file. Inside of it you should find a wrapper directory and within it a file named gradle-wrapper.properties. Its in this file you will set the gradle distribution to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants