Hi Dan,
Actually, what I want is the first option - I want that users of the
plugin *won't* have to define 'executions' - only specify my plugin in
their <plugins> section (along with optional <configuration>) and rely
on "me" to know at which phase to invoke.
Perhaps I'm getting it all wrong: as I understood, if I specify
"@phase xyz" than if the using project specifies:
<plugins>
<plugin>
<groupId>myPluginGroupId...
<artifactId>myPluginArtifactId...
Than my mojo should be invoked at the phase specified in the "@phase xyz", no?
Thanks for the help!
On 2/1/06, dan tran <[EMAIL PROTECTED]> wrote:
> @phase xyz means you dont have to define phase in your plugin execution (
> use default phase defined mojo). But you still need to define
> your plugin executions.
>
> However if you want hardwire to a phase when mojo is invoked from command
> line use @execute. See maven-assembly-plugin for example.
>
> -D
>
>
>
>
> On 1/31/06, Arik Kfir <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I have a small mojo which I want to bind to the 'process-classes'
> > phase. I've read
> > http://maven.apache.org/developers/mojo-api-specification.html which
> > indicates I should add a "@phase process-classes" to the class
> > comment, and I did:
> >
> > /**
> > *
> > * @goal generate
> > * @phase process-classes
> > * @author arik
> > */
> > public class .... {
> > ...
> > }
> >
> > In the project that uses this plugin I declared:
> >
> > <build>
> > <plugins>
> > <plugin>
> > <groupId>myGroupId</groupId>
> > <artifactId>myPluginArtifactId</artifactId>
> > <configuration>
> > <!-- ... some configuration... -->
> > </configuration>
> > </plugin>
> > </plugins>
> > </build>
> >
> > But the mojo isn't activated.
> >
> > If, however, I add this to the invoking POM (inside the above <plugin>
> > section):
> > <executions>
> > <execution>
> > <phase>process-classes</phase>
> > <goals>
> > <goal>generate</goal>
> > </goals>
> > </execution>
> > </executions>
> >
> > everything works.
> >
> > It looks like I'm missing something but I can't figure out what...I
> > went through all of the guides in the M2 site, but couldn't find a
> > reason for this. Isn't M2 supposed to bind my mojo automatically (due
> > to the @phase tag)?
> >
> >
> > --
> > Regards,
> > _____________________________________
> > Arik Kfir [EMAIL PROTECTED]
> >
>
>
--
Regards,
_____________________________________
Arik Kfir [EMAIL PROTECTED]