Is there a way to run jacoco:check outside of a maven project?

13 views
Skip to first unread message

mark.va...@unisys.com

unread,
Jan 12, 2017, 11:17:36 AM1/12/17
to JaCoCo and EclEmma Users
Is there a way to run jacoco:check outside of a maven project?

For example, I can run jacoco:dump outside of a maven project by specifying parameters on the command line.
Is there a way to do something similar for jacoco:check?

Regards.
Mark K Vallevand

Evgeny Mandrikov

unread,
Jan 13, 2017, 11:33:43 AM1/13/17
to JaCoCo and EclEmma Users, mark.va...@unisys.com
Hi Mark,

This is not possible as stated in documentation of "jacoco:check" ( http://www.jacoco.org/jacoco/trunk/doc/check-mojo.html ) - "Requires a Maven project to be executed."
Mainly because its configuration that is in pom.xml can be quite complex to be specified in command-line - http://www.jacoco.org/jacoco/trunk/doc/check-mojo.html#rules
However you can place this configuration into "separate-pom.xml" and execute "mvn -f separate-pom.xml".
Also there are other ways to integrate such checks - see JaCoCo APIs ( http://www.jacoco.org/jacoco/trunk/doc/api/index.html ), Ant Task ( http://www.jacoco.org/jacoco/trunk/doc/ant.html ), etc.

Hope this helps.

Regards,
Evgeny

mark.va...@unisys.com

unread,
Jan 13, 2017, 11:41:45 AM1/13/17
to JaCoCo and EclEmma Users, mark.va...@unisys.com
Thank you very much.
It is a great help.
I did not consider a separate pom file. Excellent.
I have been studying the API. I'm trying to avoid writing my own program and using things already working. But, if the boss wants more detailed information about coverage results, he will need to make time for it.
I don't think Ant is an option, but I'll take another look.

Regards.
Mark K Vallevand

Evgeny Mandrikov

unread,
Jan 13, 2017, 12:32:03 PM1/13/17
to JaCoCo and EclEmma Users, mark.va...@unisys.com
Forgot to mention that separate pom is not a recommendation, but just my crazy idea of possible workarounds for you ;)
Also should be noted that other integrations of JaCoCo such as Jenkins Plugin, SonarQube Plugin, etc. might be useful on a field of automatic checks.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages