【问题标题】:Gradle: Could not get unknown property 'target'Gradle:无法获取未知属性“目标”
【发布时间】:2018-10-08 16:19:24
【问题描述】:

我在build.gradle 中添加了以下任务:

    task buildLambda(type: Copy) {
    from compileJava
    from processResources
    into('lib') {
        from configurations.runtime
    }
    into target
}

build.dependsOn buildLambda  

在 Intellij IDEA 中构建项目会产生以下 Gradle 错误:

Could not get unknown property 'target' for task ':my- 
project:buildLambda' of type org.gradle.api.tasks.Copy.

但是使用 Gordon 框架成功完成了构建。有人可以帮忙吗?

【问题讨论】:

    标签: gradle intellij-idea build.gradle


    【解决方案1】:

    target 不是 Gradle 可以解释的已知属性:您应该写为 into 'target'(或:into file('target')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-14
      • 1970-01-01
      • 2017-01-28
      • 2017-10-13
      • 2021-11-01
      • 1970-01-01
      • 2018-07-10
      • 2021-01-30
      相关资源
      最近更新 更多