gpt4 book ai didi

java - Gradle eclipse 插件 : Could not find method jcenter() for arguments [] on repository container. 查看错误日志了解详情

转载 作者:搜寻专家 更新时间:2023-11-01 02:26:41 25 4
gpt4 key购买 nike

我正在尝试将我的 gradle 项目导入到 eclipse 中,但出现错误

Could not find method jcenter() for arguments [] on repository container. See error log for details

除其他外,我的 build.gradle 包含以下内容:

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-cargo-plugin:1.1'
}
}

eclipse 日志包含以下内容(为简洁起见仅发布尾部):

Caused by: org.gradle.api.internal.MissingMethodException: Could not find method jcenter() for arguments [] 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 build_21nipivver1ec19jnvd93lc92o$_run_closure1_closure2.doCall(/home/alok/cxps/dev/Seer-Clari5.4.X-baseline/workspace/AML/build.gradle:3)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:113)
at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.configure(DefaultArtifactRepositoryContainer.java:76)
at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.configure(DefaultArtifactRepositoryContainer.java:44)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:50)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94)
at org.gradle.api.internal.initialization.AbstractScriptHandler.repositories(AbstractScriptHandler.java:66)
at build_21nipivver1ec19jnvd93lc92o$_run_closure1.doCall(/home/alok/cxps/dev/Seer-Clari5.4.X-baseline/workspace/AML/build.gradle:2)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94)
at org.gradle.api.internal.project.AbstractProject.buildscript(AbstractProject.java:893)
at org.gradle.api.Project$buildscript.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.buildscript(ProjectScript.groovy:42)
at org.gradle.api.Script$buildscript.callCurrent(Unknown Source)
at build_21nipivver1ec19jnvd93lc92o.run(/home/alok/cxps/dev/Seer-Clari5.4.X-baseline/workspace/AML/build.gradle:1)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 53 more

这是 eclipse 插件的问题吗?询问是因为这在命令行和 intelliJ 上都能正常工作。

最佳答案

听起来您的 Eclipse 配置了一个较旧的 Gradle 版本,该版本还没有 jcenter 方法。确保使用 Gradle Wrapper 进行构建,并在导入 Eclipse 时选择“使用 Gradle Wrapper”。

关于java - Gradle eclipse 插件 : Could not find method jcenter() for arguments [] on repository container. 查看错误日志了解详情,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21087330/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com