This is due to a quirk of the java compiler See below from Oracle’s javac documentation
">If the -sourcepath option is not specified, the user class path is also searched for source files. "
if the compileJava task had the equivalent of the below code added by default, this would not happen.
compileJava.options.compilerArgs += “-sourcepath” compileJava.options.compilerArgs += “”
I can’t think of anytime I would want sources included with classpath jars compiled in with the rest of my code