从服务器收到状态代码 409:将 Spring Boot 应用程序迁移到 Gradle 7.3.3 时出现冲突错误
我正在将我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能否确认一下,在重现此问题时(artifactory.log(或)artifactory-service.log),您是否在 Artifactory 中观察到类似的错误模式(如下)?
如果是,则似乎是客户端发送的请求与存储库处理的请求类型之间存在冲突。考虑选中相关 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)?
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.