I created a project like this:
plugins {
id("java")
}
group = "org.glavo"
version = "1.0-SNAPSHOT"
tasks.compileJava {
exclude("module-info.java")
logger.quiet("Sources: " + source.asPath)
}
In Gradle 6, exclude("module-info.java")
can avoid compiling module-info.java
, but this is not working in Gradle 7.
By printing the log, I can see that module-info.java
does not exist in the source path of compileJava
task. However, it still always compiles in Gradle 7 (I tried 7.0~7.4.2 with the same result).
Am I doing something wrong? Why is there such a difference between Gradle 6 and Gradle 7?