title: Execute Maven plugin goal on parent module, but not on children
body: <p>We have a multi-module maven project that uses a profile that defines a <a href="http://mojo.codehaus.org/buildnumber-maven-plugin/" rel="noreferrer">buildnumber-maven-plugin</a> to increment a build number and then check it into source control.</p>
  
  <p>If I define the plugin in the parent pom.xml it executes for all the child builds as well.</p>
  
  <p>Here's my parent pom.xml</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                        http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.webwars&lt;/groupId&gt;
    &lt;artifactId&gt;parent&lt;/artifactId&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
    &lt;properties&gt;
      &lt;buildNumber.properties&gt;${basedir}/../parent/buildNumber.properties&lt;/buildNumber.properties&gt;
    &lt;/properties&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;Parent Project&lt;/name&gt;
    &lt;profiles&gt;
      &lt;profile&gt;
        &lt;id&gt;release&lt;/id&gt;
        &lt;build&gt;
          &lt;plugins&gt;
            &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                &lt;debug&gt;false&lt;/debug&gt;
                &lt;optimize&gt;true&lt;/optimize&gt;
              &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;buildnumber-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.0-beta-3&lt;/version&gt;
              &lt;executions&gt;
                &lt;execution&gt;
                  &lt;phase&gt;validate&lt;/phase&gt;
                  &lt;goals&gt;
                    &lt;goal&gt;create&lt;/goal&gt;
                  &lt;/goals&gt;
                &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                &lt;buildNumberPropertiesFileLocation&gt;${buildNumber.properties}&lt;/buildNumberPropertiesFileLocation&gt;
                &lt;getRevisionOnlyOnce&gt;true&lt;/getRevisionOnlyOnce&gt;
                &lt;doCheck&gt;false&lt;/doCheck&gt;
                &lt;doUpdate&gt;false&lt;/doUpdate&gt;
                &lt;format&gt;{0, number}&lt;/format&gt;
                &lt;items&gt;
                  &lt;item&gt;buildNumber&lt;/item&gt;
                &lt;/items&gt;
              &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-scm-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                &lt;execution&gt;
                  &lt;phase&gt;install&lt;/phase&gt;
                  &lt;goals&gt;
                    &lt;goal&gt;checkin&lt;/goal&gt;
                  &lt;/goals&gt;
                &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                &lt;basedir&gt;${basedir}&lt;/basedir&gt;
                &lt;includes&gt;buildNumber.properties&lt;/includes&gt;
                &lt;message&gt;[Automated checkin] of ${basedir} Build version: ${major.version}.${minor.version}.${buildNumber}&lt;/message&gt;
                &lt;developerConnectionUrl&gt;...&lt;/developerConnectionUrl&gt;
              &lt;/configuration&gt;
            &lt;/plugin&gt;         
          &lt;/plugins&gt;
        &lt;/build&gt;
      &lt;/profile&gt;
    &lt;/profiles&gt;
  
    &lt;modules&gt;
  
      &lt;module&gt;../common&lt;/module&gt;
      &lt;module&gt;../data&lt;/module&gt;
      &lt;module&gt;../client&lt;/module&gt;
      &lt;module&gt;../webplatform&lt;/module&gt;
    &lt;/modules&gt;
   ...
  &lt;/project&gt;
  </code></pre>