After upgrading to Gradle 2.0: Could not find property 'Compile' on root project

前端 未结 3 1791
刺人心
刺人心 2021-02-01 01:03

To avoid warnings regarding special characters when building my Java source code, I put this line in my gradle.build which worked fine before upgrading to Gradle 2.

相关标签:
3条回答
  • 2021-02-01 01:34

    For Groovy based projects. It'd be:

    tasks.withType(GroovyCompile) {
        options.debug = true
    }
    
    0 讨论(0)
  • 2021-02-01 01:36

    Changing the line to

    tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
    

    fixed the issue.

    0 讨论(0)
  • 2021-02-01 01:49

    Use task.withType(JavaCompile).

    My code:

    buildscript {
        repositories {
            jcenter()
        }
    
        dependencies {
            classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.3'
        }
    
      tasks.withType(JavaCompile) {
          options.debug = true
          options.debugOptions.debugLevel = "source,lines,vars"
          options.encoding = "UTF-8"
      }
    }
    
    0 讨论(0)
提交回复
热议问题