title: Automatic Execution Custom Maven Plugin
body: <p>I have implemented a Maven 2 plugin. </p>
  
  <p>I have that definiton for my Mojo:</p>
  
  <pre><code>/**
   * Goal which combines files.
   *
   * @goal combine
   * @phase compile
   */
  public class CombineMojo extends AbstractMojo {
  </code></pre>
  
  <p>I have to add this into my project (which uses plugin) pom:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;base-project&lt;/groupId&gt;
      &lt;artifactId&gt;base-project&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;combine-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;input&gt;src/input.html&lt;/input&gt;
                      &lt;output&gt;html/output.html&lt;/output&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;combine-maven-plugin&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;combine&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>However what should I do automatically execute it instead of defining at pom.xml. I tries adding</p>
  
  <pre><code>@execute ...
  </code></pre>
  
  <p>into my Mojo definition however it didn't work. By the way should I define an id, what is need for it?</p>