title: Extending maven plugin
body: <p>I am trying to generate a zip file assembly using the maven-assembly-plugin. There are only two problems I have left that I'm wondering if it's possible to solve with just configurations but as a last resort I am also considering writing my own maven plugin that extends the maven-assembly-plugin</p>
  
  <p>The two missing pieces are</p>
  
  <ol>
  <li><p><strong>Put each dependency that matches the include pattern into its own <code>outputDirectory</code>.</strong><br>
  This is the relevant part of my assembly</p>
  
  <pre><code>&lt;moduleSet&gt;
      &lt;binaries&gt;
          &lt;dependencySets&gt;
              &lt;dependencySet&gt;
                  &lt;outputDirectory&gt;module&lt;/outputDirectory&gt;
                  &lt;useTransitiveDependencies&gt;false&lt;/useTransitiveDependencies&gt;
                  &lt;includes&gt;
                      &lt;include&gt;com.test.feature.*:*:jar&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/dependencySet&gt;
          &lt;/dependencySets&gt;
          &lt;unpack&gt;false&lt;/unpack&gt;
      &lt;/binaries&gt;
  &lt;/moduleSet&gt;
  </code></pre>
  
  <p>This will put all dependencies of the module with a groupId of <code>com.test.feature.*</code> in a folder called module. This works for me, like so</p>
  
  <pre><code>module/
     com.test.feature.firstModule.jar
     com.test.feature.secondModule.jar
  </code></pre>
  
  <p>What I need is a way to move each of the matching dependencies to its own folder, hopefully where the folder name is the artifactId of the dependency (not mandatory though)</p>
  
  <pre><code>firstModule/
     com.test.feature.firstModule.jar
  secondModule/
     com.test.feature.secondModule.jar
  </code></pre>
  
  <p>I know that I could create a <code>dependencySet</code> for each dependency, but the idea is to do this as future-proof as possible. If I create one for each, I will need to remember in the future to create a new set for every new artifact under com.test.feature. My biggest (but blind) hope is some kind of property ${dependencyName} that would be replaced for each dependency, which then I could use in the <code>outputDirectory</code>  </p></li>
  <li><p><strong>Generate an xml file with information about the dependencies and their folders</strong><br>
  something like</p>
  
  <pre><code>&lt;module dir="firstModule" version="1.0-SNAPSHOT /&gt;
  &lt;module dir="secondModule" version="2.1-SNAPSHOT /&gt;
  </code></pre>
  
  <p>The generated xml will be part of the zip assembly</p></li>
  </ol>
  
  <p>Can these two things, or one of them, be done with the vanilla assembly plugin? If not, is it possible to create a plugin that extends another? i have just seen tutorials for creating plugins <a href="http://maven.apache.org/guides/plugin/guide-java-plugin-development.html" rel="nofollow">from scratch</a>, never to just add functionality to one of the standard plugins</p>