You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nigel Magnay <ni...@gmail.com> on 2006/08/15 17:32:28 UTC

M2 : using assembly plugin to copy part of the repository

I have a pom.xml with various dependencies included in it.

I want, in the output JAR file, to include a directory that contains a
subsection of the repository from those dependencies.

I can nearly get there, by using the assembly descriptor (at the end), but I
have 2 problems

1) I want to use the directory the M2 repo would use - the example below is
creating a directory com.cswgroup.kms.kes.config when I really want
com/cswgroup/kms/kes/config - is there a way of getting at ${groupId} with /
separators ?

2) I would like to include the .pom descriptors as well.

Is there a way of specifying this with the assembly plugin, or should I look
at rolling my own MOJO ?


<assembly>
  <id>directory</id>
  <formats>
    <format>jar</format>
   </formats>

    <dependencySets>
      <dependencySet>
        <includes>
          <include>com.cswgroup.kms.kes.config:config-kms</include>
        </includes>

<outputFileNameMapping>${groupId}/${artifactId}/${version}/${artifactId}-${version}.${extension}</outputFileNameMapping>
        <outputDirectory>/</outputDirectory>
        <unpack>false</unpack>
        <scope>runtime</scope>
      </dependencySet>
    </dependencySets>

</assembly>

Re: M2 : using assembly plugin to copy part of the repository

Posted by Barrie Treloar <ba...@gmail.com>.
> 1) I want to use the directory the M2 repo would use - the example below is
> creating a directory com.cswgroup.kms.kes.config when I really want
> com/cswgroup/kms/kes/config - is there a way of getting at ${groupId} with /
> separators ?

Can't help you on this one. Also can't really see the reason for it...

> 2) I would like to include the .pom descriptors as well.
>
> Is there a way of specifying this with the assembly plugin, or should I look
> at rolling my own MOJO ?

All jar files include the pom in the META-INF/maven folder structure.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org