[
https://jira.codehaus.org/browse/MASSEMBLY-644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319849#comment-319849
]
Maik Riechert commented on MASSEMBLY-644:
-----------------------------------------
Alright... I found the problem. The module was using the (super pom) default
plugin version (2.2-beta5) while the problematic assembly uses the current 2.4.
Apparently, the behaviour of pattern matching has changed, which is implemented
in maven-common-artifact-filters (2.2-beta5 used version 1.1, while 2.4 uses
1.4) in the method
org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter#matchAgainst.
The docs say {noformat}Additionally, wildcards can be used, as in
*:maven-*{noformat} which in my opinion is not exact enough, given the specific
behaviour of the implementation.
Changing my patterns to
{noformat}<exclude>*:lwjgl*:*:natives-*</exclude>
<exclude>*:jinput*:*:natives-*</exclude>
{noformat}
makes it work in 2.4.
If I understand the code correctly, then patterns must be given in a form
"x:y:..." where each additional ":..." segment is optional as long as nothing
else follows it. There's also some special case code which tries to handle the
other direction so that patterns can have the form "*:y:z" which means that
only the last two segments y and z are matched and must in fact be the end, and
anything before that doesn't matter. For this special case it is important
which id-forms get checked against, namely the shortId "groupId:artifactId", an
id without version "groupId:artifactId:type[:classifier]", and the fully
qualified id "groupId:artifactId:type[:classifier]:version". The fact that the
classifier is left out in the string segments to match against is a bit
troubling to me when reasoning about the matching logic, but anyway.
> Exclusions in dependencySet inside moduleSet->binaries have no effect
> ---------------------------------------------------------------------
>
> Key: MASSEMBLY-644
> URL: https://jira.codehaus.org/browse/MASSEMBLY-644
> Project: Maven 2.x Assembly Plugin
> Issue Type: Bug
> Components: dependencySet, filtering, moduleSet
> Affects Versions: 2.4
> Reporter: Maik Riechert
>
> I'm trying to create a distribution assembly of a multi-module project in a
> separate distribution module which works quite nice, except that exclusions
> of dependencies of modules seem to be ignored. This is strange, as the same
> exclusions do work in an assembly inside a submodule.
> This is the problematic descriptor:
> {{
> <?xml version="1.0" encoding="UTF-8"?>
> <assembly>
> <id>lwjgl</id>
> <formats>
> <format>zip</format>
> </formats>
> <includeBaseDirectory>false</includeBaseDirectory>
> <moduleSets>
> <moduleSet>
> <useAllReactorProjects>true</useAllReactorProjects>
> <includes>
> <include>com.ardor3d:ardor3d-animation</include>
> <include>com.ardor3d:ardor3d-awt</include>
> <include>com.ardor3d:ardor3d-collada</include>
> <include>com.ardor3d:ardor3d-core</include>
> <include>com.ardor3d:ardor3d-effects</include>
> <include>com.ardor3d:ardor3d-extras</include>
> <include>com.ardor3d:ardor3d-lwjgl</include>
> <include>com.ardor3d:ardor3d-math</include>
> <include>com.ardor3d:ardor3d-savable</include>
> <include>com.ardor3d:ardor3d-swt</include>
> <include>com.ardor3d:ardor3d-terrain</include>
> <include>com.ardor3d:ardor3d-ui</include>
> </includes>
> <binaries>
> <unpack>false</unpack>
> <dependencySets>
> <dependencySet>
> <excludes>
>
> <exclude>*:lwjgl*natives-*</exclude>
>
> <exclude>*:jinput*natives-*</exclude>
> </excludes>
> </dependencySet>
> </dependencySets>
> </binaries>
> </moduleSet>
> </moduleSets>
> <fileSets>
> <fileSet>
> <directory>target/natives</directory>
> <outputDirectory>natives</outputDirectory>
> <excludes>
> <exclude>*jogl*</exclude>
> <exclude>*nativewindow*</exclude>
> <exclude>*newt*</exclude>
> <exclude>*gluegen*</exclude>
> <exclude>META-INF/</exclude>
> </excludes>
> </fileSet>
> </fileSets>
> </assembly>
> }}
> This assembly descriptor can be found here:
> https://github.com/neothemachine/Ardor3D/blob/assembly/ardor3d-distribution/assembly-lwjgl.xml
> It produces a zip which also contains
> "lwjgl-platform-2.8.4-natives-linux.jar" and others which should be matched
> by the filter.
> The submodule where the exclusions work can be found at:
> https://github.com/neothemachine/Ardor3D/tree/assembly/ardor3d-examples
> If you need any other information, please tell me.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira