|
Correcting the example to show the filter is a child of build element, not a child of the assembly plugin's configuration element. You're right, moving the <filters> block fixed the problem. Thanks! Sorry I marked this 2.0. I was thinking Maven version (2.0.4), not plugin version. Hello, The fix works fine, indeed, for the <file> tag. I tried with the <fileset> tag and it doesn't seem to work in this case. I attached an sample derived from John's one. Here is a sample derived from John's one showing that filtering doesn't seem to worok with <fileset> tag, even with the doc fix. The assembly descriptor documentation (http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html <fileSets> but it doesn't work with version 2.2-beta1. Could you fix it? I would prefer that you fix the code more than the doc
I tested your example, and with the following assembly descriptor, the filtering works fine: <assembly> <id>bin</id> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <directory>target</directory> <outputDirectory></outputDirectory> <includes> <include>*.jar</include> </includes> </fileSet> <fileSet> <directory>${basedir}</directory> <outputDirectory>/</outputDirectory> <includes> <include>README</include> </includes> <filtered>true</filtered> </fileSet> </fileSets> </assembly> Please note that I had to specify "${basedir}" for the <directory> of the 2nd fileSet to make it work. In your first assembly descriptor, a "/" was used instead, which prevented the README file from being filtered. FilSets filtering added (see Hello, However, the following, based upon the previous, doesn't work :
<assembly>
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${basedir}/../poms/assembly/boot</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README</include>
</includes>
<filtered>true</filtered>
</fileSet>
</fileSets>
</assembly>
It appears that moduleSets cannot be filtered either. <moduleSet> <includes> <include>*:war</include> </includes> <binaries> <includeDependencies>false</includeDependencies> <outputDirectory>webapps/${artifactId}</outputDirectory> <unpack>true</unpack> <unpackOptions> <filtered>true</filtered> </unpackOptions> </binaries> </moduleSet> fails on Maven 2.0.7 and Assembly-plugin 2.2-beta-2-SNAPSHOT. I have a web.xml with a ${property} that will not get filtered when I have evidence all other <files> are filtered appropriately. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The documentation is wrong for versions 2.1 and 2.2-SNAPSHOT. The filters element is really a child of <build> element not the plugin's <configuration>. To be attached is a patch to the documentation.
I got this to work with maven 2.0.4 and versions 2.1 and 2.2-SNAPSHOT of the assembly plugin.
I was unable to use your pom with version 2.0 of the assembly plugin because the goal 'attached' does not apparently exist in that version of the plugin. I guess when you selected 'version' for this issue report, you didn't mean to select 2.0.