On Friday, April 3, 2020 at 12:18:14 PM UTC+2, [email protected] wrote: > > Please forgive me my stupidity. Your last comment, nr. 3, can you start > the agent without using a main class? E.g. a normal scenario as I've > interpreted the agent would be, java- javaagent:/jacocoagent.jar=[options] > com.example.myapp.HelloWorld, but is it possible to start the agent through > Dockerfile with a CMD ["sh", "-c", "./script.bash [similar to the above for > the jacocoagent]"] without adding any main class to the jvm? With other > words, if you have a docker container running a java application, can you > trigger the agent with the CMD above without adding any main class or must > you always provide a main class to be added to the jacocoagent so it can do > the coverage? >
Let me quote some page from many on the internet - https://www.journaldev.com/12552/public-static-void-main-string-args-java-main-method Java main method is the entry point of *any java program*. Back to your example this means that your application already has main class. And somewhere in your "script.bash" there is already command "java". Whether or not and how you can pass "-javaagent" from cmd that calls "script.bash" down to this "java" command is not a question for JaCoCo developers, but for developers of your "script.bash" - please talk with them. -- You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/d288d3ce-ff23-4db5-8e2a-6c06bb9face8%40googlegroups.com.
