Gradle不允许我使用options.compilerArgs
标签添加以下编译器参数:
compileJava {
options.incremental = true
options.fork = true
options.failOnError = true
options.encoding = 'UTF-8'
options.forkOptions.executable = 'javac'
options.compilerArgs += [ "-processor com.company.apt.EngineProcessor", "-s /nvme/test/gradle_testing/project/engine/modules/engine/ejb/src"]
}
执行此命令以构建Java(1.8)项目时出现以下错误:
$ gradle clean build --no-build-cache
错误:
> Task :compileJava FAILED
javac: invalid flag: -processor com.company.apt.EngineProcessor
Usage: javac <options> <source files>
use -help for a list of possible options