You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ashley Williams <ag...@mac.com> on 2005/10/11 15:29:00 UTC
[m2] calling plugin keeps maven stuck in a loop
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] (solved) calling plugin keeps maven stuck in a loop
Posted by Ashley Williams <ag...@mac.com>.
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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org