gpt4 book ai didi

gradle - 排除依赖

转载 作者:行者123 更新时间:2023-12-03 05:46:40 29 4
gpt4 key购买 nike

我想从依赖项中排除依赖项:

dependencies {
...
implementation "org.springframework.security:spring-security-web:$springSecurityVersion" {

exclude "org.springframework:spring-core:$springSecurityVersion"
exclude "org.springframework:spring-beans:$springSecurityVersion"
exclude "org.springframework:spring-context:$springSecurityVersion"
exclude "org.springframework:spring-web:$springSecurityVersion"
}
...
}

我通过改变语法糖尝试了几种选择,但徒劳无功。

更新后的异常:
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.1-bin.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsume
...

除了我认为可能有用的另一行是

Could not find method org.springframework.security:spring-security-web:5.0.4.RELEASE() for arguments [build_8wp04892dra2g2ruliafngaad$_run_closure3$_closure5@28d49bbc] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

最佳答案

您是否尝试过此语法,但未指定版本:

implementation ("org.springframework.security:spring-security-web:$springSecurityVersion") {
exclude group: 'org.springframework', module: 'spring-core'
exclude group: 'org.springframework', module: 'spring-beans'
exclude group: 'org.springframework', module: 'spring-context'
exclude group: 'org.springframework', module: 'spring-web'
}

编辑:删除您的主目录中的 .gradle目录,然后重试

edit2:答案是固定的,感谢op的评论

关于gradle - 排除依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49792014/

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