从服务器收到状态代码 409:将 Spring Boot 应用程序迁移到 Gradle 7.3.3 时出现冲突错误

发布于 2025-01-09 06:50:02 字数 1761 浏览 1 评论 0原文

我正在将我的 Spring Boot 应用程序从 Gradle 5.3 移动到 Gradle 7.3.3。我对 build.gradle 进行了相应的更改,如下所示:

这只是一个片段

buildscript {
    ext {
        springBootVersion = '2.2.7.RELEASE'
        set('springCloudVersion', "Hoxton.SR6")
        log4jVersion = '2.17.0'
    }
    repositories {
        jcenter {
            url "https://jcenter.bintray.com/"
        }
        maven {
            url "https://artifactory.build.xxx.com"
            credentials {
                username = user
                password = pwd
            }
        }
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    
    dependencies {
        implementation(group: 'com.xxx.ym', name: 'external-service', version: '0.1.11', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'conformance-service', version: '1.0.2', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'security-service', version: '0.1.17', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'product-service', version: '1.2.0-9.0-development', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'service-client', version: '0.7.2')
        implementation(group: 'com.xxx.ym', name: 'reasons-service', version: '0.7.1')
        implementation('org.springframework.boot:spring-boot-starter-hateoas')
        implementation('org.springframework.boot:spring-boot-starter-security')
    }
}

当我尝试使用 gradlew clean build --refresh-dependencies 进行干净构建时,我总是得到 Could不是获取'https://artifactory.build.ym.com/XXXX-SNAPSHOT/com/xxx/ym/external-service/0.1.11/external-service-0.1.11.pom'。从服务器收到状态代码 409:我们自己的工件中存在的依赖项发生冲突错误。使用 Gradle 5.3 构建成功,没有任何错误。

I am moving my spring boot application from Gradle 5.3 to Gradle 7.3.3. I have mad the changes in the build.gradle accordingly as below:

It's just a snippet

buildscript {
    ext {
        springBootVersion = '2.2.7.RELEASE'
        set('springCloudVersion', "Hoxton.SR6")
        log4jVersion = '2.17.0'
    }
    repositories {
        jcenter {
            url "https://jcenter.bintray.com/"
        }
        maven {
            url "https://artifactory.build.xxx.com"
            credentials {
                username = user
                password = pwd
            }
        }
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    
    dependencies {
        implementation(group: 'com.xxx.ym', name: 'external-service', version: '0.1.11', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'conformance-service', version: '1.0.2', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'security-service', version: '0.1.17', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'product-service', version: '1.2.0-9.0-development', classifier: 'clientApi')
        implementation(group: 'com.xxx.ym', name: 'service-client', version: '0.7.2')
        implementation(group: 'com.xxx.ym', name: 'reasons-service', version: '0.7.1')
        implementation('org.springframework.boot:spring-boot-starter-hateoas')
        implementation('org.springframework.boot:spring-boot-starter-security')
    }
}

When I try to do a clean build using gradlew clean build --refresh-dependencies I am always getting Could not GET 'https://artifactory.build.ym.com/XXXX-SNAPSHOT/com/xxx/ym/external-service/0.1.11/external-service-0.1.11.pom'. Received status code 409 from server: Conflict error for dependencies which are present in our own artifactory. With Gradle 5.3 the build was succeeding without any errors.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自演自醉 2025-01-16 06:50:02

您能否确认一下,在重现此问题时(artifactory.log(或)artifactory-service.log),您是否在 Artifactory 中观察到类似的错误模式(如下)?

Sending HTTP error code 409: The repository 'REPOSITORY_NAME' rejected the resolution of an artifact 'REPOSITORY_NAME:FILE_PATH' due to conflict in the snapshot release handling policy

如果是,则似乎是客户端发送的请求与存储库处理的请求类型之间存在冲突。考虑选中相关 Artifactory 呼吸设置下的“处理发布”和“处理快照”复选框。这应该有助于解决这个问题。

Could you please confirm if you are observing a similar pattern of error in Artifactory as below while reproducing this issue (artifactory.log (or) artifactory-service.log)?

Sending HTTP error code 409: The repository 'REPOSITORY_NAME' rejected the resolution of an artifact 'REPOSITORY_NAME:FILE_PATH' due to conflict in the snapshot release handling policy

If yes, then it appears to be the conflict between the request sent from the client and the type of request handled by the repository. Consider checking "Handle Releases" and "Handle Snapshots" checkboxes under the concerned Artifactory's respiratory settings. This should help to resolve this issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文