title: Maven plugin dependency - using the source plugin in all my poms
body: <p>I would like to configure the use of the maven source plugin for all our projects. The way our projects are currently configured we have a parent pom that is inherited by all the projects. So, in order for all projects to use the maven source plugin, I did the following:</p>
  
  <ol>
  <li><p>Defined the maven source plugin under <code>build -&gt; plugin management</code> in the parent pom</p>
  
  <blockquote>
  <pre><code>            &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2.1&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;attach-sources&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;jar-no-fork&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  </blockquote></li>
  <li><p>In my project pom (the child pom), I have included the source plugin under <code>build -&gt; plugins</code></p></li>
  </ol>
  
  <blockquote>
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
  </code></pre>
  </blockquote>
  
  <p>Could someone please tell me if this is the best way to configure this? Is there any way you can avoid specifying the source plugin in the child pom?</p>