Jo,

        Wow, that explanation was insightful.  Have you had an luck with
unpacking excludes?  I.e. if I want to jar together a bunch of other
"unpacked" jars and exclude any *.txt (for example) files.

I've tried an assembly descriptor that looks like:

    <dependencySet>
      <outputDirectory></outputDirectory>
      <outputFileNameMapping></outputFileNameMapping>
                <unpack>true</unpack>
                <unpackOptions>
                        <excludes>
                                <exclude>**/*.txt</exclude>
                                <exclude>/*.txt</exclude>
                                <exclude>*.txt</exclude>
                        </excludes>
                </unpackOptions>
    </dependencySet>

But it just refuses to "exclude" the txt files in the dependency jars and
then end up in my final executable jar.

Any clues?

Thanks,

Randall 

NOTE: I posted this question about a week ago but didn't get a response that
I'm aware of so if somebody did answer this already, my apologies.

-----Original Message-----
From: Jo Vandermeeren [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 26, 2007 12:10 PM
To: Maven Users List
Subject: Re: Assembly plugin bug?

Hi Tommy,

That's no bug.. The assembly plugin filters resources on a per-file basis,
it doesn't apply filtering on fileSets.

So, define a file set for all files that don't need filtering and add
excludes for files that you want to filter..
Then, define <file> elements for the files that you wan to filter and set
<filtered> to true on them..

Here's a snippet:

<assembly>
  <id>blabla</id>
  <formats>
    <format>zip</format>
  </formats>
  <fileSets>
    <fileSet>
      <directory>${basedir}</directory>
      <includes>*.sh</includes>
      <excludes>
        <exclude>install.sh</exclude>
      </excludes>
    </fileSet>
  </fileSets>
  <files>
    <file>
      <source>install.sh</source>
      <outputDirectory>/</outputDirectory>
      <filtered>true</filtered>
    </file>
  </files>
</assembly>



Cheers
Jo

On 2/26/07, Tommy Knowlton <[EMAIL PROTECTED]> wrote:
>
> I'm trying to use the maven-assembly-plugin to build a zip that
> contains an install.sh at the top level, along with some arbitrary
> other artifacts.
>
> I want the install.sh source to be filtered so that certain build-time
> variables will be run-time literals.
>
> I've tried to compose an assembly descriptor to do this, but Maven2 is
> telling me about the "Unrecognized tag: 'filtered'".
>
> I wonder whether anybody here that is familiar with the
> maven-assembly-plugin can tell me what I've done wrong?
>
> My assembly descriptor looks like the following:
>
> <assembly>
>     <id>overlay</id>
>     <formats>
>         <format>zip</format>
>     </formats>
>     <fileSets>
>         <fileSet>
>             <directory>src/main/bash</directory>
>             <filtered>true</filtered>  <!-- also tried <filtered /> -->
>             <outputDirectory></outputDirectory>
>             <includes>
>                 <include>install.sh</include>
>             </includes>
>         </fileSet>
>         <fileSet>
>             <directory>target</directory>
>             <outputDirectory></outputDirectory>
>             <includes>
>                 <include>*.jar</include>
>             </includes>
>         </fileSet>
>     </fileSets>
> </assembly>
>
> Thanks,
> --
> Tommy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
BEGIN:VCARD
VERSION:2.1
N:Fidler;Randall
FN:Randall Fidler
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20050926T075331Z
END:VCARD

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to