Hi Miral,

The problem is that you need to add an id to each of your execution. Don't call two maven-antrun-plugins but two executions with an id inside ONE maven-antrun-plugin

Here is an example in a pom.xml :

<plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>cobertura-instrument</id>
            <phase>compile</phase>
            <configuration>
              <tasks>
        
<cobertura-instrument todir="target/cobertura/instrumented-classes">
                        <ignore regex="org.apache.log4j.*" />
                        <fileset dir="target/classes">
                                <include name="**/*.class" />
                                <exclude name="**/*Test.class" />
                        </fileset>
                </cobertura-instrument>
        
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
          <execution>
            <id>cobertura-report</id>
            <phase>test</phase>
            <configuration>
              <tasks>
        
<cobertura-report format="html" destdir="target/cobertura/coverage" >
                        <fileset dir="src/main/java">
                                <include name="**/*.java"/>
                        </fileset>
                </cobertura-report>
        
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
     </plugin>

It works for me, hope it helps...

Le Jan 6, 2006, à 7:58 PM, Shah, Miral a écrit :


Hi,
I am building a web app using maven 2.0.
I have specified the following in my POM file:

  <build>
    <plugins>

          <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <configuration>
              <tasks>
                            <echo message="Hello World 1"/>
                  </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

          <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>install</phase>
            <configuration>
              <tasks>
                            <echo message=" Hello World 2"/>
                                
                          </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

Now in both the executions, it just executes 'echo message="Hello World
1"/>'. Any idea? Shouldn't it execute 'echo message="Hello World 2"/>'
the second time (during install phase)?

Many thanks,
Miral

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



Mathieu Vanderwhale

___________________________________________

DENALI sa - http://www.denali.be
Château de Clerlande - 1340 Ottignies - Belgium
Tel +32 (0) 10 43 99 51 - Fax +32 (0) 10 43 99 52
___________________________________________


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

Reply via email to