General rule here is: If a task is a task dependency then it will be executed at runtime. Executed does not necessarily mean that its actions are executed. It could be UP-TO-DATE or SKIPPED.
To your question. compileJava is a task dependency all all the tasks you list: 1)-3)