gpt4 book ai didi

maven - Gradle 构建错误

转载 作者:行者123 更新时间:2023-12-04 23:22:07 27 4
gpt4 key购买 nike

由于此错误,我的构建失败:

A problem occurred evaluating project ':DBSupport'. > Could not find method providedCompile() for arguments [project ':Core:Platform '] on project ':DBSupport'.



知道这意味着什么吗?
description = 'DBSupport main component of DBSupportTool'
dependencies {
providedCompile project(':Core:Platform')
providedCompile project(':Core:Verification')
providedCompile project(':DBSupportWeb')
providedCompile project(':DBSupportEJB')
compile(group: 'commons-lang', name: 'commons-lang', version:'1.0.1') {
/* This dependency was originally in the Maven provided scope, but the project was not of type war.
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
compile(group: 'commons-logging', name: 'commons-logging', version:'1.0.4') {
/* This dependency was originally in the Maven provided scope, but the project was not of type war.
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
compile(group: 'javax', name: 'j2ee', version:'1.0') {
/* This dependency was originally in the Maven provided scope, but the project was not of type war.
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}

最佳答案

我认为这些模块实际上应该被视为已提供(例如,不应该是 WAR 存档中的包)。如果不只是将其更改为编译。
providedCompile Gradle 中没有开箱即用的配置。如果这是一个网络模块,你可以添加/应用一个 war 插件:

apply plugin: 'war'

如果没有,您应该能够手动添加此配置:
configurations {
providedCompile
}

dependencies {
providedCompile project(':Core:Platform')
...
}

sourceSets.main.compileClasspath += configurations.providedCompile
sourceSets.test.compileClasspath += configurations.providedCompile
sourceSets.test.runtimeClasspath += configurations.providedCompile

还有一个 propdeps-plugin它声称透明地做同样的事情。

关于maven - Gradle 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21236931/

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