Gradle构建错误 [英] Gradle Build Error

查看:125
本文介绍了Gradle构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的构建因此错误而失败:


评估项目':DBSupport'时发生问题。 >无法在
项目':DBSupport'上找到
方法provideCompile()的参数[project':Core:Platform']]。

任何想法意味着什么?

  description ='DBSupport DBSupportTool的主要组件'
依赖关系{
provideCompile项目(':Core:Platform')
providedCompile项目(':Core:Verification')
providesCompile项目(':DBSupportWeb')
providesCompile项目(' :DBSupportEJB')
compile(group:'commons-lang',name:'commons-lang',version:'1.0.1'){
/ *这个依赖最初在Maven提供的范围,但该项目并非战争类型。
Gradle尚不支持此行为,所以此依赖关系已转换为编译依赖关系。
请在审核完成后检查并删除此封口。 * /
}
编译(group:'commons-logging',名称:'commons-logging',版本:'1.0.4'){
/ *这个依赖最初是在Maven提供了范围,但该项目不属于战争类型。
Gradle尚不支持此行为,所以此依赖关系已转换为编译依赖关系。
请在审核完成后检查并删除此封口。 * /
}
编译(组:'javax',名称:'j2ee',版本:'1.0'){
/ *这个依赖最初在Maven提供的范围内,该项目不属于战争类型。
Gradle尚不支持此行为,所以此依赖关系已转换为编译依赖关系。
请在审核完成后检查并删除此封口。 * /
}


解决方案

实际上应该按照提供的方式处理(例如,不应该将其包装在WAR档案中)。如果不是仅仅改变它就可以编译。



providedCompile 配置在开箱即用的Gradle中不可用。如果这是一个Web模块,您可以添加/应用一个war插件:

  apply plugin:'war'

如果不是,您应该可以手动添加此配置:



< pre $ 配置{
providesCompile
}

依赖关系{
providedCompile项目(':Core:Platform')
...
}

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

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


My build failed due to this error:

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

Any idea what that means?

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. */
}

解决方案

I assume these modules should in fact be treated as provided (e.g. should not be packages in a WAR archive). If not just change it to compile.

providedCompile configuration is not available in Gradle out of the box. If this is a web module you can just add/apply a war plugin:

apply plugin: 'war'

If not you should be able to add this configuration manually:

configurations {
    providedCompile
}

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

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

There is also a propdeps-plugin which claims to do the same thing transparently.

这篇关于Gradle构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆