How to suppress java compiler options when using modules


(Vincent Botteman) #1

Based on the guide https://guides.gradle.org/building-java-9-modules/ I’m trying to compile my Java code using modules. I’m also using annotation processors.
Gradle compiles the Java code with the arguments
-source 11 -target 11 -d … -g -sourcepath -proc:none -XDuseUnsharedTable=true -classpath --processor-module-path … --module-path …
The presence of the arguments sourcepath and proc:none obstructs the compilation using modules.
Is there a way to suppress these arguments?

compileJava {
    inputs.property("moduleName", moduleName)
    doFirst {
        options.compilerArgs = [
                '--processor-module-path', effectiveAnnotationProcessorPath.asPath,
                '--module-path', classpath.asPath
        ]
        classpath = files()
        options.annotationProcessorPath = files()
    }
}