title: executing a script from maven inside a multi module project
body: <p>I have this multi-module project.</p>
  
  <p>In the beginning of each build I would like to run some bat file.</p>
  
  <p>So i did the following:</p>
  
  <pre><code>&lt;profile&gt;
              &lt;id&gt;deploy-db&lt;/id&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
   &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/plugin&gt;
                  &lt;/plugins&gt;
                  &lt;pluginManagement&gt;
                      &lt;plugins&gt;
                          &lt;plugin&gt;
                              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                              &lt;version&gt;1.1.1&lt;/version&gt;
                              &lt;executions&gt;
                                  &lt;execution&gt;
                                      &lt;phase&gt;validate&lt;/phase&gt;
                                      &lt;goals&gt;
                                          &lt;goal&gt;exec&lt;/goal&gt;
                                      &lt;/goals&gt;
                                      &lt;inherited&gt;false&lt;/inherited&gt;
                                  &lt;/execution&gt;
                              &lt;/executions&gt;
                              &lt;configuration&gt;
                                  &lt;executable&gt;../database/schemas/import_databases.bat&lt;/executable&gt;
                              &lt;/configuration&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/pluginManagement&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
  </code></pre>
  
  <p>when i run the <code>mvn verify -Pdeploy-db</code> from the root I get this script executed over and over again in each of my modules.</p>
  
  <p>I want it to be executed only once, in the root module.</p>
  
  <p>What is there that I am missing ?</p>
  
  <p>Thanks</p>