You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Guillaume Polet <gu...@gmail.com> on 2009/06/05 13:18:27 UTC

Assembling assemblies with exclude/include patterns

Hello,

I'm kind of new to the assembly plugin but I'm starting to get some 
stuff out of it. However there is one trick I couldn't get to work so 
far, so I'm looking for some help on this.

Here is my situation: I have a bunch of projects which all produce a jar 
file (without any resources, just classes) and a zip file containing all 
the resources (no classes, no jars). This works smoothly and I'm very 
happy of the output they each produce.
On addition to that, I have four projects that are various combination 
of the projects mentionned above. What I would like to do is to have 
them produce a zip file with the following structure: all the resources 
(located in the zip previously created) of the projects they depend of 
at the top of the zip file, and within a lib directory, all the jars 
they depend of.
To do this, I have added 2 dependecy sets: one to include all jars and 
place them in a lib directory, and one to unpack all my zips.
I think I'm really close to a solution, but I have one problem, which is 
that all my classes are also included along the resources. It seems that 
the exclusion patterns donnot work with the second dependency set.
Is there a way to get to what I would like, or is this simply not possible?

Many thanks in advance


Guillaume Polet

My assembly descriptor for those four projects look like this:
<assembly>
  <id>packaging</id>
  <formats>
    <format>zip</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
      <includes>
          <include>*.jar</include>
      </includes>
      <excludes>
          <exclude>*.zip</exclude>
      </excludes>
      <outputDirectory>lib</outputDirectory>
    </dependencySet>
    <dependencySet>
      <unpack>true</unpack>
      <outputDirectory></outputDirectory>
      <includes>
          <include>*.zip</include>
      </includes>
      <excludes>
          <exclude>*.jar</exclude>
      </excludes>
      <unpackOptions>
          <excludes>
              <exclude>*.class</exclude>
              <exclude>**/*.class</exclude>
              <exclude>META-INF</exclude>
          </excludes>
      </unpackOptions>
    </dependencySet>
  </dependencySets>
</assembly>
 


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


Re: Assembling assemblies with exclude/include patterns

Posted by Guillaume Polet <gu...@gmail.com>.
Ok, well, worry that I have bothered you because I found my issues since.
Two stuffs were actually causing my problems:
1) My repository was somehow corrupted and there were two shared jars 
containing the same descriptor. The plugin was using an old one instead 
of the ones I was updating while trying to find a solution
2) the include/exclude patterns were incorrect and replacing *.jar by 
*:jar:* and *.zip by *:zip:* did the trick. This is a little bit 
confusing because the include/exclude patterns in the dependency sets 
are not the same as in filesets (which by the way is logical but the 
documentation does not really specify that they are different)

I am just posting this so that if anyone run into the same issue, he can 
read the solution I have found.

Guillaume Polet

Guillaume Polet a écrit :
> Hello,
>
> I'm kind of new to the assembly plugin but I'm starting to get some 
> stuff out of it. However there is one trick I couldn't get to work so 
> far, so I'm looking for some help on this.
>
> Here is my situation: I have a bunch of projects which all produce a 
> jar file (without any resources, just classes) and a zip file 
> containing all the resources (no classes, no jars). This works 
> smoothly and I'm very happy of the output they each produce.
> On addition to that, I have four projects that are various combination 
> of the projects mentionned above. What I would like to do is to have 
> them produce a zip file with the following structure: all the 
> resources (located in the zip previously created) of the projects they 
> depend of at the top of the zip file, and within a lib directory, all 
> the jars they depend of.
> To do this, I have added 2 dependecy sets: one to include all jars and 
> place them in a lib directory, and one to unpack all my zips.
> I think I'm really close to a solution, but I have one problem, which 
> is that all my classes are also included along the resources. It seems 
> that the exclusion patterns donnot work with the second dependency set.
> Is there a way to get to what I would like, or is this simply not 
> possible?
>
> Many thanks in advance
>
>
> Guillaume Polet
>
> My assembly descriptor for those four projects look like this:
> <assembly>
>  <id>packaging</id>
>  <formats>
>    <format>zip</format>
>  </formats>
>  <includeBaseDirectory>false</includeBaseDirectory>
>  <dependencySets>
>    <dependencySet>
>      <includes>
>          <include>*.jar</include>
>      </includes>
>      <excludes>
>          <exclude>*.zip</exclude>
>      </excludes>
>      <outputDirectory>lib</outputDirectory>
>    </dependencySet>
>    <dependencySet>
>      <unpack>true</unpack>
>      <outputDirectory></outputDirectory>
>      <includes>
>          <include>*.zip</include>
>      </includes>
>      <excludes>
>          <exclude>*.jar</exclude>
>      </excludes>
>      <unpackOptions>
>          <excludes>
>              <exclude>*.class</exclude>
>              <exclude>**/*.class</exclude>
>              <exclude>META-INF</exclude>
>          </excludes>
>      </unpackOptions>
>    </dependencySet>
>  </dependencySets>
> </assembly>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>


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