Thanks for looking into it. I've been doing some reading, and according
to this:
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
if the @execute phase=generate-sources is specified on the Mojo (which
it is in this case), you cannot stop the fork from happening. Its up to
the plugin itself to check if the mojo has already been run on its own.
I noticed that the dependency plugin does this with its markers
directory so it knows not to unpack the dependency again. Perhaps the
antrun plugin is doing this too, which is why i don't get the 2nd echo
in my example. I have control over some of my plugins, but
unfortunately, jspc and xdoclet, I don't, and they get run multiple
times (in my realworld case). Bahhh...
-Ben
Brian E. Fox wrote:
Assembly:attached is the correct one, but you are right, the sources one
is probably doing it. I'm using sources and not having that issue. Let
me look...
<artifactId>maven-source-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>attach-source</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<attach>true</attach>
</configuration>
</execution>
</executions>
</plugin>
-----Original Message-----
From: Ben Tatham [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 3:13 PM
To: Maven Users List
Subject: Re: plugin runs multiple times
I think it also might be the maven-source-plugin. The source-plugin
mojos both have a
@execute phase=generate-sources
which I think means run that phase again. Is there a way to make it not
do that when run from a pom instead of the cmd line?
-Ben
Brian E. Fox wrote:
The war doesn't use the dependency plugin (btw you should update to
maven-dependency-plugin 2.0-alpha-x since it supereceeds the old mojo
one). Do you have assembly:assemble bound to a phase? That forks the
entire build and could cause what you see. Pasting your pom would help
too.
-----Original Message-----
From: Ben Tatham [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 10:57 AM
To: Maven Users List
Cc: [EMAIL PROTECTED]
Subject: Re: plugin runs multiple times
I have tracked my problem down a bit further...the second lifecycle
starts sometime around the package phase in the lifecycle. I think it
may have something to do with the fact that during the validate phase,
I unpack parent WAR on my own using the dependency-maven-plugin so
that I can extract the web.xml file and merge it with the new one (I
am using xdoclet).
Does the war plugin just call on dependency-maven-plugin too to do the
war overlap? If so, perhaps that is what is triggering the 2nd
lifecycle run from validate? Or is it something else?
How do I make it stop happening?!?! A quote from "Better Builds with
Maven", Section 5.3.1: "In good mojo design, determining when not to
execute, is often as important as the modifications made during
execution itself."
Any help is appreciated.
-Ben
Wayne Fay wrote:
Also see this page for more specific usage info for the help plugin:
http://maven.apache.org/plugins/maven-help-plugin/usage.html
Wayne
On 3/21/07, Wayne Fay <[EMAIL PROTECTED]> wrote:
Try mvn help:effective-pom in your top-level project to see what
plugins map where with what configurations etc. Perhaps that will
help you figure out what's going on.
Wayne
On 3/21/07, Ben Tatham <[EMAIL PROTECTED]> wrote:
Hello all,
I have a scenario where my plugins (antrun, xdoclet, custom stuff)
get run multiple times. I think this has something to do with some
plugins
forkin a new lifecycle, but I can't figure out:
1) which ones are doing that
2) good description of how to stop this from happening.
I have parent poms defining some plugins, and I have pushed things
around into pluginManagement instead, but this does not seem to
help.
-Ben
-------------------------------------------------------------------
-- 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]
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]