<build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <id>echodir</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>verify</phase>
*            <inherited>false</inherited>*   <!-- this is the
inherited you want -->
            <configuration>
              <tasks>
                <echo>Build Dir: ${project.build.directory}</echo>
              </tasks>
            </configuration>
          </execution>
        </executions>

      </plugin>
    </plugins>
  </build>



On 18 March 2010 11:59, izak.wessels <izak.wess...@gmail.com> wrote:

>
>
> stephenconnolly wrote:
> >
> > give each execution a different <id>
> >
> > and if you don;t want something inherited by child projects, set
> > <inherited>false
> >
>
> Yup, we tried that.
>
> Example :
>
> <build>
> <plugins>
>  <plugin>
>    <groupId>org.apache.maven.plugins</groupId>
>    <artifactId>maven-pmd-plugin</artifactId>
>    <version>2.4</version>
>    <executions>
>      <execution>
>         <id>pmd-default</id>
>         <phase>generate-sources</phase>
>        <goals>
>          <goal>check</goal>
>        </goals>
>      </execution>
>       <execution>
>        <id>pmd-sonar</id>
>         <phase>generate-sources</phase>
>        <goals>
>          <goal>pmd</goal>
>        </goals>
>      </execution>
>    </executions>
>  </plugin>
> </plugins>
> </build>
>
> 2 issues with that approach:
>
>
> 1. How do we tell maven which execution we want to run?
>

You don't

It will run all the executions that are bound to the lifecycle automatically

If you want something different, use ANT, or hack away using profiles and
activation rules and then spend ages explainging to people why even though
you have used a build tool which has a standard lifecycle, you are ignoring
that and ending up back in the "what ant task do I run to do ___" mire


>
> 2. From what we understand you cannot just say <inherited>false</inherited>
> in the child pom.xml, you would have to do something like,
>
> <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>  <artifactId>maven-pmd-plugin</artifactId>
>  <inherited>false</inherited>
> </plugin>
>
> However, we still want our plugin to run in our child projects, just run
> against a different goal based on question 1
>
> --
> View this message in context:
> http://n2.nabble.com/How-to-Invoke-different-goals-of-1-plugin-tp4755892p4755993.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to