title: How do I link a plugin execution to a phase in maven without forcing me to specify plugin on command line
body: <p>I have a simple pom and added an ant-run to the compile but it only executes then when I do the following:
  mvn install antrun:run<br>
  mvn install    -- doesn't process the ant-run
  mvn antrun:run -- doesn't process the ant-run</p>
  
  <p>I thought that be linking the plugin to the lifecyce phase that the plugin would be executed when I try to achieve that phase.  This is not what is happening.    </p>
  
  <p><strong>Am I missing some nuance, do I need to have a profile which enables the plugin?</strong></p>
  
  <p>Thanks for the help (pom below)</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.mycompany.app&lt;/groupId&gt;
  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;my-app&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;build&gt;
      &lt;pluginManagement&gt;
  &lt;plugins&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.3&lt;/version&gt;
      &lt;executions&gt;    
        &lt;execution&gt;
          &lt;id&gt;antecho&lt;/id&gt;
          &lt;phase&gt;compile&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;run&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;tasks&gt;
            &lt;echo message="Hello,world"/&gt;
            &lt;/tasks&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
  
          &lt;/plugin&gt;
       &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
      &lt;/build&gt;
  &lt;dependencies&gt;
  &lt;dependency&gt;
  &lt;groupId&gt;junit&lt;/groupId&gt;
  &lt;artifactId&gt;junit&lt;/artifactId&gt;
  &lt;version&gt;3.8.1&lt;/version&gt;
  &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>