Gradle - compileJava - remove compile Warnings

前端 未结 4 1041
醉话见心
醉话见心 2020-12-18 20:14

We use Gradle 2.1 and java plugin. During compileJava different warnings occur, for example:

warning: [options] bootstrap class path not set in conjunction w         


        
相关标签:
4条回答
  • 2020-12-18 20:53

    Try adding:

    options.compilerArgs += '-Xlint:-deprecation'
    
    0 讨论(0)
  • 2020-12-18 20:55

    try this:

    tasks.withType(JavaCompile) {
        options.warnings = false
    }
    
    0 讨论(0)
  • 2020-12-18 20:57

    No answer posted so far that currently works (Gradle 4.0.1), so here's what does work:

    options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    
    0 讨论(0)
  • 2020-12-18 21:11

    I think it really depends on the warnings. For the warnings I was getting, this worked:

        tasks.withType(JavaCompile) {
            options.compilerArgs += ["-nowarn", "-XDenableSunApiLintControl"]
        }
    

    Sanity restored.

    0 讨论(0)
提交回复
热议问题