web-dev-qa-db-ja.com

Gradle-引数のメソッドmavenRepo()が見つかりませんでした

カスケードパターン プロジェクト、 インストール済みGradle 2. -実行して表彰しました

gradle Eclipse --stacktrace

そして私は次のようになります-根本的な原因は何ですか?

J-MacBook-Pro:pattern J$ gradle Eclipse --stacktrace

FAILURE: Build failed with an exception.

* Where:
Script '/Users/J../Documents/.../pattern/etc/s3Upload.gradle' line: 28

* What went wrong:
A problem occurred evaluating script.
> Could not find method mavenRepo() for arguments [{name=monochromeroad, url=http://conjars.org/repo/}] on repository container.

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

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating script.
    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.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.Java:98)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.Java:36)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.Java:67)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.Java:130)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.Java:41)
    at org.gradle.api.Project$apply$0.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
    at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
    at build_lri38cub9qal6ms4fm481qs9d.run(/Users/Julian/Documents/workspace_nonbook/pattern/build.gradle:22)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.Java:52)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.Java:187)
    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:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.Java:470)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.Java:79)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.Java:31)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.Java:128)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.Java:105)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.Java:85)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.Java:81)
    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:39)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.Java:29)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.Java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.Java:171)
    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)
Caused by: org.gradle.api.internal.MissingMethodException: Could not find method mavenRepo() for arguments [{name=monochromeroad, url=http://conjars.org/repo/}] on repository container.
    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.dsl.DefaultRepositoryHandler_Decorated.invokeMethod(Unknown Source)
    at s3Upload_447b4416rad4bgj0fk7141bgil$_run_closure1_closure2.doCall(/Users/Julian/Documents/workspace_nonbook/pattern/etc/s3Upload.gradle:28)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.Java:59)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.Java:130)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.Java:110)
    at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.configure(DefaultArtifactRepositoryContainer.Java:66)
    at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.configure(DefaultArtifactRepositoryContainer.Java:33)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.Java:51)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.Java:130)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.Java:91)
    at org.gradle.api.internal.initialization.DefaultScriptHandler.repositories(DefaultScriptHandler.Java:70)
    at s3Upload_447b4416rad4bgj0fk7141bgil$_run_closure1.doCall(/Users/Julian/Documents/workspace_nonbook/pattern/etc/s3Upload.gradle:25)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.Java:59)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.Java:130)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.Java:91)
    at org.gradle.groovy.scripts.DefaultScript.buildscript(DefaultScript.Java:106)
    at org.gradle.api.Script$buildscript.callCurrent(Unknown Source)
    at s3Upload_447b4416rad4bgj0fk7141bgil.run(/Users/Julian/Documents/workspace_nonbook/pattern/etc/s3Upload.gradle:24)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.Java:52)
    ... 42 more
11
hawkeye

mavenRepoはGradle1.8以降非推奨になり、Gradle2.0で削除されました。

これはbuild.gradleの69行目の誤ったリポジトリです:

mavenRepo name: 'conjars', url: 'http://conjars.org/repo/'

そして/etc/s3Upload.gradleにもう1つ

mavenRepo name: 'monochromeroad', url: 'http://conjars.org/repo/'

それらを次のリポジトリに置き換えます。

maven {
    url 'http://conjars.org/repo/'
}
21
Tom Verelst

彼らは古いバージョンのgradleを使用しています。バージョン2.0で古いmavenRepoメソッドが削除されたと思います。 Here は、非推奨としてマークされたときの参照です。

2
The End