Change output directory of generated code in gradle
问题 Project contains annotation processor which generates java code during compilation. By default, gradle outputs generated source files into build/classes directory. That causes some problems with discovery of newly generated source files by IntelliJ. Is there any straightforward way of configuring gradle to output source files into another directory? For example $buildDir/gen/main/java or $buildDir/build/generated/main/java ? 回答1: There is an option for java compiler which allows to customize