My POM uses jacoco-maven-plugin and is currently setup with prepare-agent and report goals.
Right now Jacoco works perfect giving me all detail line numbers and source code highlighting where code was not covered.
I'm curious can Jacoco do code coverage at all and do it at this level of detail if /src/main/java did not exist and only the built files(eg JAR and classes) existed in /target?
Appreciate any insight. Reading the below link seems to indicate this is possible just not seeing how everything should be setup and configured at the project level.
https://www.eclemma.org/jacoco/trunk/doc/maven.html
Thanks Marc.
Appreciate the detail. If i'm hearing you correctly the only thing I lose if the source code under /src/main/java is not available is source code highlighting.
Can you tell me is it sufficient that I only have the built files under /target to accomplish the rest of reporting or does my project structure need to be different. Any detail you can give or docs you can point me to would be great!

Thank you Evgeny and Marc.
Really appreciate your responses as I start using this tool.
I have one final question. Does "prepare-agent" goal require /src/main/java or does it reuse existing class files in /target to instrument them?
I have one final question. Does "prepare-agent" goal require /src/main/java or does it reuse existing class files in /target to instrument them?