无法应用 io.spring.dependency-management Gradle 插件

发布于 2025-01-10 21:32:50 字数 1355 浏览 0 评论 0原文

我在所有工作构建中都使用了 io.spring.dependency-management Gradle 插件,并且从未遇到过任何问题。它就是有效的。 以下是我本地设置的部分内容:

build.gradle:

plugins {
    ...
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    ...
}
repositories {
    mavenCentral()
}
dependencyManagement {
    imports {
        mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Hoxton.SR8'
    }
}

settings.gradle:

pluginManagement {
resolutionStrategy {
    eachPlugin {
        switch (requested.id.id) {
        ...
            case 'io.spring.dependency-management':
                useModule("io.spring.gradle:dependency-management-plugin:${requested.version}")
                break
        ...

当我尝试构建时,我可以在日志中看到:

Apply plugin io.spring.dependency-management to root project 'my-project' completed
...
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > A problem occurred evaluating root project 'my-project'
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > No signature of method: build_97hpysomemorerandomshere.dependencyManagement() is applicable for argument types: (build_97hpysomemorerandomshere$_run_closure4) values: [build_97hpysomemorerandomshere$_run_closure4@2d5aa553]

对我来说,这只是告诉我尚未应用依赖项管理,因此该插件附带的功能无法访问。

我一直看着拼写,直到我累了,我对自己做错了什么有点不知道。

预先感谢您的帮助。

I am using the io.spring.dependency-management Gradle plugin in all our work builds and never had an issue with it. It just works.
Here are parts of my local setup:

build.gradle:

plugins {
    ...
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    ...
}
repositories {
    mavenCentral()
}
dependencyManagement {
    imports {
        mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Hoxton.SR8'
    }
}

settings.gradle:

pluginManagement {
resolutionStrategy {
    eachPlugin {
        switch (requested.id.id) {
        ...
            case 'io.spring.dependency-management':
                useModule("io.spring.gradle:dependency-management-plugin:${requested.version}")
                break
        ...

When I try to build I can see in the logs:

Apply plugin io.spring.dependency-management to root project 'my-project' completed
...
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > A problem occurred evaluating root project 'my-project'
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > No signature of method: build_97hpysomemorerandomshere.dependencyManagement() is applicable for argument types: (build_97hpysomemorerandomshere$_run_closure4) values: [build_97hpysomemorerandomshere$_run_closure4@2d5aa553]

To me this is just telling me the dependency-management has not been applied and such the functions coming with that plugin are not accessible.

I look at the spellings until I got tired and I am a bit out of ideas about what I am doing wrong.

Thank you in advance for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文