You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Arik Kfir <ar...@gmail.com> on 2007/10/24 21:44:36 UTC
unpackOptions tag has no effect
Hi,
I have a multi-module project, where one of the modules is a WAR, with
several dependencies
packaged in its WEB-INF/lib directory. The top-level project builds an
assembly, which needs
to contain the WAR in an unpacked form.
I used the <unpack>true</unpack> and <unpackOptions> tags to make sure the
WAR is unpacked AND to exclude its "WEB-INF/lib" directory.
The problem is that the excludes in 'unpackOptions' doesn't seem to affect
the assembly; my JARs
are still unpacked from the WAR and stored in my assembly.
POM structure is:
myproject ("pom" packaging, does NOT extend parent)
|
+---parent module ("pom" packaging, others extend this one)
|
+---war module ("war" packaging, extends parent)
|
+---other modules...
The assembly descriptor is as follows (created on the 'package' phase of the
lifecycle):
=====================================
<assembly>
<id>slim-application</id>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<includes>
<include>org.myproject:war:*:*</include>
</includes>
<binaries>
<!-- the directory in the dist to contain the WAR contents
-->
<outputFileNameMapping>application</outputFileNameMapping>
<useStrictFiltering>true</useStrictFiltering>
<!-- filter out our dependencies, they are already in the
WEB-INF/lib -->
<includeDependencies>false</includeDependencies>
<!-- unpack our WAR - this works great -->
<unpack>true</unpack>
<!-- make sure that we don't include the libraries from our
WAR by excluding them -->
<unpackOptions>
<excludes>
<exclude>**/*.jar</exclude>
</excludes>
</unpackOptions>
</binaries>
</moduleSet>
</moduleSets>
<files>
...
...(irrelevant to this mail)
...
</files>
</assembly>
====================================
Note that instead of "**/*.jar" I have also tried "/WEB-INF/lib/*.jar",
"/WEB-INF/lib", and similar combinations, but to no avail.
If anyone has encountered anything like that, or if you spot something I'm
doing wrong here - I'd appreciate your help.
Thanks,
Arik Kfir.
Re: unpackOptions tag has no effect
Posted by Wayne Fay <wa...@gmail.com>.
I'm not using excludes in unpackOptions myself, but make sure:
1. This functionality is available in a public release, and not just a snapshot
2. You've specified the a release version that has this functionality
in your pom <plugin> declaration
Many times I've seen people add a pom snippet from the mailing list,
Jira, or even the plugin documentation without realizing that it won't
necessarily work since that functionality is not yet available in a
released plugin version. Check the @since tag in the plugin docs.
Wayne
On 10/24/07, Arik Kfir <ar...@gmail.com> wrote:
> Hi,
>
> I have a multi-module project, where one of the modules is a WAR, with
> several dependencies
> packaged in its WEB-INF/lib directory. The top-level project builds an
> assembly, which needs
> to contain the WAR in an unpacked form.
>
> I used the <unpack>true</unpack> and <unpackOptions> tags to make sure the
> WAR is unpacked AND to exclude its "WEB-INF/lib" directory.
>
> The problem is that the excludes in 'unpackOptions' doesn't seem to affect
> the assembly; my JARs
> are still unpacked from the WAR and stored in my assembly.
>
> POM structure is:
>
> myproject ("pom" packaging, does NOT extend parent)
> |
> +---parent module ("pom" packaging, others extend this one)
> |
> +---war module ("war" packaging, extends parent)
> |
> +---other modules...
>
>
> The assembly descriptor is as follows (created on the 'package' phase of the
> lifecycle):
> =====================================
> <assembly>
> <id>slim-application</id>
> <formats>
> <format>tar.gz</format>
> <format>zip</format>
> </formats>
> <includeBaseDirectory>false</includeBaseDirectory>
> <moduleSets>
> <moduleSet>
> <includes>
> <include>org.myproject:war:*:*</include>
> </includes>
> <binaries>
>
> <!-- the directory in the dist to contain the WAR contents
> -->
> <outputFileNameMapping>application</outputFileNameMapping>
>
> <useStrictFiltering>true</useStrictFiltering>
>
> <!-- filter out our dependencies, they are already in the
> WEB-INF/lib -->
> <includeDependencies>false</includeDependencies>
>
> <!-- unpack our WAR - this works great -->
> <unpack>true</unpack>
>
> <!-- make sure that we don't include the libraries from our
> WAR by excluding them -->
> <unpackOptions>
> <excludes>
> <exclude>**/*.jar</exclude>
> </excludes>
> </unpackOptions>
> </binaries>
> </moduleSet>
> </moduleSets>
> <files>
> ...
> ...(irrelevant to this mail)
> ...
> </files>
> </assembly>
> ====================================
> Note that instead of "**/*.jar" I have also tried "/WEB-INF/lib/*.jar",
> "/WEB-INF/lib", and similar combinations, but to no avail.
>
> If anyone has encountered anything like that, or if you spot something I'm
> doing wrong here - I'd appreciate your help.
> Thanks,
> Arik Kfir.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: unpackOptions tag has no effect
Posted by Antony Stubbs <an...@gmail.com>.
Please vote for:
http://jira.codehaus.org/browse/MASSEMBLY-298
arikkfir wrote:
>
> Hi,
>
> I have a multi-module project, where one of the modules is a WAR, with
> several dependencies
> packaged in its WEB-INF/lib directory. The top-level project builds an
> assembly, which needs
> to contain the WAR in an unpacked form.
>
> I used the <unpack>true</unpack> and <unpackOptions> tags to make sure the
> WAR is unpacked AND to exclude its "WEB-INF/lib" directory.
>
> The problem is that the excludes in 'unpackOptions' doesn't seem to affect
> the assembly; my JARs
> are still unpacked from the WAR and stored in my assembly.
>
> POM structure is:
>
> myproject ("pom" packaging, does NOT extend parent)
> |
> +---parent module ("pom" packaging, others extend this one)
> |
> +---war module ("war" packaging, extends parent)
> |
> +---other modules...
>
>
> The assembly descriptor is as follows (created on the 'package' phase of
> the
> lifecycle):
> =====================================
> <assembly>
> <id>slim-application</id>
> <formats>
> <format>tar.gz</format>
> <format>zip</format>
> </formats>
> <includeBaseDirectory>false</includeBaseDirectory>
> <moduleSets>
> <moduleSet>
> <includes>
> <include>org.myproject:war:*:*</include>
> </includes>
> <binaries>
>
> <!-- the directory in the dist to contain the WAR contents
> -->
> <outputFileNameMapping>application</outputFileNameMapping>
>
> <useStrictFiltering>true</useStrictFiltering>
>
> <!-- filter out our dependencies, they are already in the
> WEB-INF/lib -->
> <includeDependencies>false</includeDependencies>
>
> <!-- unpack our WAR - this works great -->
> <unpack>true</unpack>
>
> <!-- make sure that we don't include the libraries from
> our
> WAR by excluding them -->
> <unpackOptions>
> <excludes>
> <exclude>**/*.jar</exclude>
> </excludes>
> </unpackOptions>
> </binaries>
> </moduleSet>
> </moduleSets>
> <files>
> ...
> ...(irrelevant to this mail)
> ...
> </files>
> </assembly>
> ====================================
> Note that instead of "**/*.jar" I have also tried "/WEB-INF/lib/*.jar",
> "/WEB-INF/lib", and similar combinations, but to no avail.
>
> If anyone has encountered anything like that, or if you spot something I'm
> doing wrong here - I'd appreciate your help.
> Thanks,
> Arik Kfir.
>
>
-----
___________________________
http://stubbisms.wordpress.com http://stubbisms.wordpress.com
--
View this message in context: http://www.nabble.com/unpackOptions-%3Cexcludes%3E-tag-has-no-effect-tp13394951p18993141.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org