Until recently I had a jar task definition like this:
jar {
exclude ‘**/*.xml’
}
For some reason we didn’t want to include Xml files from ‘src/main/resources’.
This policy changed, and it was decided to just include one of the multiple Xml files. So I changed the jar definition like this:
jar {
exclude '**/*.xml’
include ‘src/main/resources/job-universalimport-aktionen.xml’
}
Now, this resulted in compile errors! The compiler complained about not finding classes from another subproject. First, this led me to find the cause of the problem in some changed java sources or changed gradle properties. Nothing caused this problem. So I changed the jar task to this
jar {
exclude ‘/job-control*.xml’
exclude '/job-service*.xml’
}
and the compile errors went away. (That is: I could not say exclude-all-xml but include-specific-xml.)
I tested with Gradle 2.4.1 and Gradle 3.0. Maybe it is naive to think that the jar task definition should not influence compile dependencies? After all, this is not a compile dependency definition.