My plugin annotation was wrong I incorrectly used execute phase instead of just phase. Not sure if the mojo api help page has been rewritten or not, but somehow seems more helpful this time round!

On 11 Oct 2005, at 14:29, Ashley Williams wrote:

I'm trying to use a plugin I wrote in another project and so created a build section like this:

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.sandbox.maven</groupId>
                                <artifactId>jaxme-plugin</artifactId>
                                <version>1.0-SNAPSHOT</version>
                                <configuration>
<schema>src/main/resources/ com/williams1000/command/services.xsd</schema> <targetPackage>com.williams1000.command.xjc</targetPackage>
                                </configuration>
                                <executions>
                                        <execution>
<!--phase>generate- sources</phase-->
                                                <goals>
<goal>xjc</ goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>

I got a few strange behaviors though.

1. If I invoke the plugin at the command line "m2 org.sandbox.maven:jaxme-plugin:xjc" this works fine. However if I comment back in the phase then I get an infinite loop on running that same command:
[INFO] Preparing jaxme:xjc
[INFO] Preparing jaxme:xjc
[INFO] Preparing jaxme:xjc
... forever

2. No matter, I only want to call the plugin as part of m2 install lifecycle. But when I do, my plugin isn't invoked. ie "m2 install" doesn't cause the plugin to be executed. This is when the phase tag is commented out.

3.I feel I shouldn't have to comment in the phase tag because I've already declared my mojo with the annotation @execute phase="generate-sources" so surely this should be default. Despite this reservation I comment it back in and again run "m2 install" and this time I get the infinite loop behavior.

I got this behavior when I ran against beta 3 and then again at HEAD

What's going wrong?

In case it's important here is my mojo declaration:

/**
* Jaxme codegen mojo.
*
* @goal xjc
* @execute phase="generate-sources"
*/
public class XjcMojo extends AbstractMojo {



Thanks
AW

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to