Re: [java code coverage] default lifecycle phase of jacoco:prepare-agent
Hi Andreas, Note that order of goals in same phase is dictated by order of declaration of plugins, so "test" phase is not the best default - most likely will lead to a lot of questions. "prepare-agent" sets property, so "initialize" phase was chosen as a first (prior to "test") best match according to description of phases on page https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html So far (5 years since inception of jacoco-maven-plugin) "initialize" phase was a good default choice. And so seems better to not change this now - it might be quite notable change for users that were able to rely on this choice for many years. And to me seems that this is a first time that we hear that "initialize" is not a good default. Might be interesting to see exact example, when it causes trouble. Best regards, Evgeny On Saturday, November 12, 2016 at 10:30:29 AM UTC+1, andreas.man...@gmail.com wrote: > > Hello Mirko, > > sure I can switch away from the default phase, but shouldn't the default > be the best value for most cases? I'd expect that the agent init could run > right before the test case execution? Might be i miss something here? > > For the skip - do you run these projects with skipTests set? > > Kind Regards, > Andreas. > > > Am Samstag, 29. Oktober 2016 12:59:52 UTC+2 schrieb Mirko Friedenhagen: > > Hello, > > > > you mean skip when maven.test.skip is set? > > > > You may achieve this easily by referencing this property in the > default-prepare-agent execution. There you may easily redefine the bound > phase as well. > > > > I use jacoco in projects which have no tests run by surefire or failsafe > but the invoker plugin, so this could break my use case :-). > > > > Regards > > > > Mirko > > > > -- > > > > Sent from my mobile > > > > > > > > Am 29.10.2016 12:15 schrieb: > > Hello list, > > > > > > > > sorry if this has been already discussed. I just came across this and > I'm not sure to understand it fully. > > > > > > > > I wonder why the jacoco:prepare-agent maven goal is bound to the very > early lifecycle phase "initialize"? Wouldn't be a later phase be more > reasonable? > > > > > > > > I assume in most cases this does not matter - nevertheless I've a nested > multi module maven project here which breaks because the inherited > "prepare-agent" needs to be evaluated so early and maven misses to find > dependent modules. > > > > > > > > One 2nd thing, would it be possible to automatically ignore the > "prepare-agent" if tests are skipped? > > > > > > > > Thanks for feedback, > > > > > > > > Kind Regards, Andreas. > > > > > > > > > > > > -- > > > > 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 jacoco+un...@googlegroups.com. > > > > To view this discussion on the web visit > https://groups.google.com/d/msgid/jacoco/0f162cb6-a604-4e85-b2bb-7d9cbf20a6d6%40googlegroups.com > . > > > > For more options, visit https://groups.google.com/d/optout. > > -- 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 jacoco+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/df68bfb3-48fc-4a8b-b3a3-f27d94c07a0c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [java code coverage] default lifecycle phase of jacoco:prepare-agent
skipTests and maven.skip.test have different semantics, the first one will only skip execution of surefire and failsafe while with the latter even the compilation of test sources will be skipped. So if you want to run your ITs only you would need skipTests=true and skipITs=false. You could set two properties in your project: false ${skipTests} I do not run the projects with skipTests. I do not know why prepare-agent comes that early but it should definitely be latest in phase testCompile. Maybe Marc has a better explanation why he chose to use initialize. Regards Mirko -- Sent from my mobile Am 12.11.2016 10:30 schrieb: > Hello Mirko, > > sure I can switch away from the default phase, but shouldn't the default > be the best value for most cases? I'd expect that the agent init could run > right before the test case execution? Might be i miss something here? > > For the skip - do you run these projects with skipTests set? > > Kind Regards, > Andreas. > > > Am Samstag, 29. Oktober 2016 12:59:52 UTC+2 schrieb Mirko Friedenhagen: > > Hello, > > > > you mean skip when maven.test.skip is set? > > > > You may achieve this easily by referencing this property in the > default-prepare-agent execution. There you may easily redefine the bound > phase as well. > > > > I use jacoco in projects which have no tests run by surefire or failsafe > but the invoker plugin, so this could break my use case :-). > > > > Regards > > > > Mirko > > > > -- > > > > Sent from my mobile > > > > > > > > Am 29.10.2016 12:15 schrieb : > > Hello list, > > > > > > > > sorry if this has been already discussed. I just came across this and > I'm not sure to understand it fully. > > > > > > > > I wonder why the jacoco:prepare-agent maven goal is bound to the very > early lifecycle phase "initialize"? Wouldn't be a later phase be more > reasonable? > > > > > > > > I assume in most cases this does not matter - nevertheless I've a nested > multi module maven project here which breaks because the inherited > "prepare-agent" needs to be evaluated so early and maven misses to find > dependent modules. > > > > > > > > One 2nd thing, would it be possible to automatically ignore the > "prepare-agent" if tests are skipped? > > > > > > > > Thanks for feedback, > > > > > > > > Kind Regards, Andreas. > > > > > > > > > > > > -- > > > > 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 jacoco+un...@googlegroups.com. > > > > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jacoco/0f162cb6-a604-4e85-b2bb-7d9cbf20a6d6%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > > -- > 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 jacoco+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jacoco/c2538d47-d56d-4531-9cc7-3aefca44d614%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 jacoco+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/CAK8jvqzjicfbqOyZOs7vDYhe-oOVv8LDK6503mDvnCZyLpr7Zg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [java code coverage] default lifecycle phase of jacoco:prepare-agent
Hello, you mean skip when maven.test.skip is set? You may achieve this easily by referencing this property in the default-prepare-agent execution. There you may easily redefine the bound phase as well. I use jacoco in projects which have no tests run by surefire or failsafe but the invoker plugin, so this could break my use case :-). Regards Mirko -- Sent from my mobile Am 29.10.2016 12:15 schrieb: > Hello list, > > sorry if this has been already discussed. I just came across this and I'm > not sure to understand it fully. > > I wonder why the jacoco:prepare-agent maven goal is bound to the very > early lifecycle phase "initialize"? Wouldn't be a later phase be more > reasonable? > > I assume in most cases this does not matter - nevertheless I've a nested > multi module maven project here which breaks because the inherited > "prepare-agent" needs to be evaluated so early and maven misses to find > dependent modules. > > One 2nd thing, would it be possible to automatically ignore the > "prepare-agent" if tests are skipped? > > Thanks for feedback, > > Kind Regards, Andreas. > > > -- > 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 jacoco+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jacoco/0f162cb6-a604-4e85-b2bb-7d9cbf20a6d6%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 jacoco+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/CAK8jvqz6ssmOp2_rokktu%2B_BzvpMpyWmdNsSYSYuHKGvRepBAA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[java code coverage] default lifecycle phase of jacoco:prepare-agent
Hello list, sorry if this has been already discussed. I just came across this and I'm not sure to understand it fully. I wonder why the jacoco:prepare-agent maven goal is bound to the very early lifecycle phase "initialize"? Wouldn't be a later phase be more reasonable? I assume in most cases this does not matter - nevertheless I've a nested multi module maven project here which breaks because the inherited "prepare-agent" needs to be evaluated so early and maven misses to find dependent modules. One 2nd thing, would it be possible to automatically ignore the "prepare-agent" if tests are skipped? Thanks for feedback, Kind Regards, Andreas. -- 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 jacoco+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/0f162cb6-a604-4e85-b2bb-7d9cbf20a6d6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.