On Sun, Jun 12, 2005 at 11:52:55AM +0200, Vincent Massol wrote: > > > > -----Original Message----- > > From: Brett Porter [mailto:[EMAIL PROTECTED] > > Sent: lundi 2 mai 2005 09:02 > > To: Maven Developers List > > Subject: Re: lifecycle design: clover and other use cases > > I've started working on the m2 clover plugin again and I'd like to continue > our design discussion. > > ATM I have one mojo that binds to the generate-sources phase and that > generates clovered sources in a target directory. > > Now the issue is that those generated files are not yet picked up by the > compiler:compile goal. I'm about to try modifying the > ${project.compileSourceRoots} in CloverMojo but I don't know if that'll have > any effect on the CompilerMojo...
From the Modello Maven plugin[1]:
project.addCompileSourceRoot( outputDirectory );
where project is declared like this:
/**
* @parameter expression="${project}"
* @required
*/
private MavenProject project;
>
> [snip]
>
> > >I'm not sure I understand the "@executePhase <somephase>" tag? Is it like
> > a
> > >m1 prereqs in that it tells m2 to execute the <somephase> phase before
> > >executing the mojo goal?
> > >
> > Yes, it is sort of a prereq, except that it is always executed if the
> > other goal is attained, and there is only one. It's better thought of as
> > a clean, parallel invocation of the lifecycle. It's currently being used
> > in idea:idea to ensure generate-sources is called.
>
> In the IdeaMojo, there is:
>
> /**
> * @goal idea
> * @executePhase generate-sources
> * @requiresDependencyResolution test
>
> I still don't understand the difference between "@phase generate-sources"
> and "@executePhase generate-sources".
>
> Also, could you please explain what @requiresDependencyResolution means?
By having this tag Maven will make sure that all the dependencies of a
project is downloaded. This is what makes the clean plugin not download
all dependencies before execution.
> Are you suggesting to use an executePhase instead of a phase for the
> CloverMojo?
>
> [snip]
>
> > >"Desired use:
> > >- m2 clover:clover
> > > 1) register clover compiler goal into generate-sources
> > > 2) modify output directory
> > > 3) run test (based on executePhase)
> > > 4) report database later reused"
> > >
> > >Does this cover the following m1 use case: "maven clover:on war
> > clover:off"?
> > >
> > >
> > So you can include those classes in the WAR? Yes. Just set a different
> > executephase, and change the finalName.
>
> Are you saying that executePhase can be specified by the plugin's user in
> the pom.xml file?
>
> > >How do you tell clover:clover that it should execute the war goal or
> > >anything else for that matter?
> > >
> > >
> > <executePhase/>. This part may require more thought - I have a bunch of
> > alternative ideas locally - these seemed the best to me, but if there
> > are any holes then I'm up for changing it.
>
> I still don't understand this. Has this been firmed up throught the recent
> design talks?
Think of executePhase as a separate invocation of Maven. When running the
idea plugin (which has executePhase=generate-resources) Maven will execute
the generate-sources and generate-resources phases. Each plugin that has
@phase=generate-sources or generate-resources will also execute in this
subexecution and thus properly add any generates sources directories to
the compile sources set.
> Thanks
> -Vincent
[1]:
http://cvs.modello.codehaus.org/modello/modello-maven-plugin/src/main/java/org/codehaus/modello/maven/AbstractModelloGeneratorMojo.java?rev=1.2&view=auto
--
Trygve
signature.asc
Description: Digital signature
