OK. I have run some test stuff just to try to figure out how this stuff works...

I added this:
     <plugin>
       <artifactId>maven-antrun-plugin</artifactId>
       <inherited>false</inherited>
       <executions>
           <execution>
               <goals><goal>run</goal></goals>
               <phase>generate-sources</phase>
               <configuration>
                 <tasks>
<echo>********************** Generating Sources...</echo>
                 </tasks>
               </configuration>
                   </execution>
       </executions>
     </plugin>
to a very simple pom that inherits from my pom that has this:

         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-source-plugin</artifactId>
           <executions>
             <execution>
               <goals>
                 <goal>jar</goal>
                 <goal>test-jar</goal>
               </goals>
             </execution>
           </executions>
         </plugin>

I just wanted to see how often my echo comes out...well, of course it happens the first time through...:

[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
    [echo] ********************** Generating Sources...
[INFO] Executed tasks
[INFO] [resources:resources]

And then after the tests have all passed, I get the following:

[INFO] [jar:jar]
[INFO] Building jar: C:\work\util\BenTatham\target\util-1.0.3-SNAPSHOT.jar
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] [source:jar {execution: default}]
[INFO] Building jar: C:\work\util\BenTatham\target\util-1.0.3-SNAPSHOT-sources.jar
[INFO] Preparing source:test-jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [WARNING] Removing: test-jar from forked lifecycle, to prevent recursive invocation.
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] [source:test-jar {execution: default}]
[INFO] Building jar: C:\work\util\BenTatham\target\util-1.0.3-SNAPSHOT-test-sources.jar

Notice that although the echo itself didn't happen, it does say it is running antrun and executing tasks.
Now I am even more confused than before!  Please help...

-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]

Reply via email to