Am 17.11.2015 5:22 nachm. schrieb Jason van Zyl <[email protected]>:
>
>
> > On Nov 17, 2015, at 11:02 AM, Thomas Meyer <[email protected]> wrote: 
> > 
> > Hi, 
> > 
> > okay thanks. 
> > 
> > Another question: 
> > 
> > What does it mean when a mojo execution is forked? 
> > 
>
> It corresponds to the execute annotation[1] where if you execute a goal and 
> need to make sure the prerequisite lifecycle has run prior to said goal then 
> Maven will “fork” a lifecycle to make sure this requirement is met. Before 
> the goal is executed the lifecycle is run up to the phase you specify your 
> goal needs. So your Mojo might have something like: 
>
> @Execute(phase=“LifecyclePhase.COMPILE”) 
>
> As your mojo needs to operate on compiled classes this will make sure the 
> compiled classes are there. 
>
> [1]: 
> https://github.com/apache/maven-plugin-tools/blob/trunk/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java
>  

Hi,

many thanks for the hint! I understand it now. So basically every mojo callable 
from command line somehow need to set this annotation and all mojos only usable 
in the pom doesn't!

Thank you!

>
> > I tried to find some documentation about it, but I failed. 
> > 
> > The maven CLI execution event logger class seems to give some hint: 
> >>>> fork started and so on. 
> > 
> > Given the following pom 
> > https://github.com/thomasmey/einkaufsliste-server/blob/master/pom.xml 
> > 
> > The wildfly-swarm-plugin has two executions, but the compiler step and the 
> > annotation preprocessor plugin seems to be executed for both mojo 
> > executions? Why is that? I had the idea that each mojo execution happens 
> > only once without all predecessors for each defined execution step, but 
> > that doesn't seem to be the case. 
> > 
> > So who can bring some light in this and/or point me in the right direction 
> > and some documentation? 
> > 
> > With kind regards 
> > Thomas 
> > 
> > 
> > Am 16.11.2015 4:04 nachm. schrieb Jason van Zyl <[email protected]>: 
> >> 
> >> If you use Eclipse you can go to the project properties and from there 
> >> Maven > Lifecycle Mapping and you’ll see something like this: 
> >> 
> >> 
> >> 
> >> If you don’t use Eclipse you can probably use this: 
> >> 
> >> https://github.com/takari/maven-profiler 
> >> 
> >> It was made for profiling but will show you the executions. There is 
> >> another more recent tool that shows the lifecycle but I can’t recall at 
> >> the moment what that is. I will try to remember and post when I do. 
> >> 
> >>> On Nov 16, 2015, at 9:55 AM, Thomas Meyer <[email protected]> wrote: 
> >>> 
> >>> Hi, 
> >>> 
> >>> How can I print a graph of a given maven invocation with the lifecycle 
> >>> and for each lifecycle step which plugins are executed? 
> >>> 
> >>> E.g. 
> >>> 
> >>> lifecycle: 
> >>>  step 3: generate-sources 
> >>>    plugin 1 - maven-processor-plugin 
> >>>    plugin 2 - ... 
> >>>  step 4: process-sources 
> >>>    plugin 1 - xxx 
> >>> 
> >>> because in my pom, a plugin is executed several times but it shouldn't! 
> >>> So i want to find out why. I tried with mvn -X but I couldn't see why a 
> >>> plugin was executed twice. 
> >>> 
> >>> with kind regards 
> >>> thomas 
> >>> 
> >>> 
> >>> 
> >>> --------------------------------------------------------------------- 
> >>> To unsubscribe, e-mail: [email protected] 
> >>> For additional commands, e-mail: [email protected] 
> >>> 
> >> 
> >> Thanks, 
> >> 
> >> Jason 
> >> 
> >> ---------------------------------------------------------- 
> >> Jason van Zyl 
> >> Founder, Takari and Apache Maven 
> >> http://twitter.com/jvanzyl 
> >> http://twitter.com/takari_io 
> >> --------------------------------------------------------- 
> >> 
> >> First, the taking in of scattered particulars under one Idea, 
> >> so that everyone understands what is being talked about ... Second, 
> >> the separation of the Idea into parts, by dividing it at the joints, 
> >> as nature directs, not breaking any limb in half as a bad carver might. 
> >> 
> >>   -- Plato, Phaedrus (Notes on the Synthesis of Form by C. Alexander) 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> > 
> > --------------------------------------------------------------------- 
> > To unsubscribe, e-mail: [email protected] 
> > For additional commands, e-mail: [email protected] 
>
> Thanks, 
>
> Jason 
>
> ---------------------------------------------------------- 
> Jason van Zyl 
> Founder, Takari and Apache Maven 
> http://twitter.com/jvanzyl 
> http://twitter.com/takari_io 
> --------------------------------------------------------- 
>
> Be not afraid of growing slowly, be only afraid of standing still. 
>
> -- Chinese Proverb 
>
>
>
>
>
>
>
>
>
>
>
>
>
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [email protected] 
> For additional commands, e-mail: [email protected] 
>

Reply via email to