You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tommy Knowlton <To...@KE4KUG.net> on 2007/02/26 20:00:08 UTC

Assembly plugin bug?

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Assembly plugin bug?

Posted by Randall Fidler <ra...@testadvantage.com>.
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:jo.vandermeeren@gmail.com] 
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 <To...@ke4kug.net> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Assembly plugin bug?

Posted by Brad Szabo <bs...@unicon.net>.
There already is a JIRA issue about the lack of filtering support within
filesets. Feel free to vote on it if you would like :)

http://jira.codehaus.org/browse/MASSEMBLY-154

-Brad

On Mon, 2007-02-26 at 20:49 +0100, Jo Vandermeeren wrote:
> Hi Tommy,
> 
> Well.. You could file a jira issue for that if it bothers you ;)
> Usually the standard plugins have good examples though:
> http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html
> 
> Glad to see that you got it on track..
> 
> Cheers
> Jo
> 
> On 2/26/07, Tommy Knowlton <To...@ke4kug.net> wrote:
> >
> > Yes, that works. And I also verified that the description of the xml
> > on the assembly descriptor web page incorrectly indicates that
> > <filtered/> tag is a child of <fileSet/>. (I didn't think I had
> > hallucinated that...)
> >
> > Thanks again.
> >
> > On 2/26/07, Tommy Knowlton <To...@ke4kug.net> wrote:
> > > Thanks, Jo. I'll give that a try. Perhaps this is what confused me:
> > > http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html
> > >
> > > On 2/26/07, Jo Vandermeeren <jo...@gmail.com> wrote:
> > > > 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 <To...@ke4kug.net> 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: users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > > --
> > > Tommy
> > >
> >
> >
> > --
> > --
> > Tommy
> >
> > ---------------------------------------------------------------------
> > 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


Re: Assembly plugin bug?

Posted by Jo Vandermeeren <jo...@gmail.com>.
Hi Tommy,

Well.. You could file a jira issue for that if it bothers you ;)
Usually the standard plugins have good examples though:
http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html

Glad to see that you got it on track..

Cheers
Jo

On 2/26/07, Tommy Knowlton <To...@ke4kug.net> wrote:
>
> Yes, that works. And I also verified that the description of the xml
> on the assembly descriptor web page incorrectly indicates that
> <filtered/> tag is a child of <fileSet/>. (I didn't think I had
> hallucinated that...)
>
> Thanks again.
>
> On 2/26/07, Tommy Knowlton <To...@ke4kug.net> wrote:
> > Thanks, Jo. I'll give that a try. Perhaps this is what confused me:
> > http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html
> >
> > On 2/26/07, Jo Vandermeeren <jo...@gmail.com> wrote:
> > > 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 <To...@ke4kug.net> 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: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> >
> >
> > --
> > --
> > Tommy
> >
>
>
> --
> --
> Tommy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Assembly plugin bug?

Posted by Tommy Knowlton <To...@KE4KUG.net>.
Yes, that works. And I also verified that the description of the xml
on the assembly descriptor web page incorrectly indicates that
<filtered/> tag is a child of <fileSet/>. (I didn't think I had
hallucinated that...)

Thanks again.

On 2/26/07, Tommy Knowlton <To...@ke4kug.net> wrote:
> Thanks, Jo. I'll give that a try. Perhaps this is what confused me:
> http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html
>
> On 2/26/07, Jo Vandermeeren <jo...@gmail.com> wrote:
> > 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 <To...@ke4kug.net> 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: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
>
> --
> --
> Tommy
>


-- 
--
Tommy

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


Re: Assembly plugin bug?

Posted by Tommy Knowlton <To...@KE4KUG.net>.
Thanks, Jo. I'll give that a try. Perhaps this is what confused me:
http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html

On 2/26/07, Jo Vandermeeren <jo...@gmail.com> wrote:
> 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 <To...@ke4kug.net> 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: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>


-- 
--
Tommy

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


Re: Assembly plugin bug?

Posted by Jo Vandermeeren <jo...@gmail.com>.
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 <To...@ke4kug.net> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>