Discussion:
[jira] [Commented] (MASSEMBLY-675) Maven Assembly packaging wildcard-excluded dependencies
Tomer Cohen (JIRA)
2015-04-13 01:29:13 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14491824#comment-14491824 ]

Tomer Cohen commented on MASSEMBLY-675:
---------------------------------------

+1 for this issue
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: John Casey
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Michael Osipov (JIRA)
2016-05-14 23:40:12 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15283726#comment-15283726 ]

Michael Osipov commented on MASSEMBLY-675:
------------------------------------------

Still present in 3.0-SNAPSHOT.
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: John Casey
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Matthias Müller (JIRA)
2017-07-17 08:04:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16089462#comment-16089462 ]

Matthias Müller commented on MASSEMBLY-675:
-------------------------------------------

Is there any chance to get this fixed? It's one of the top-10 voted tickts for this project...
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: John Casey
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
Matthias Müller (JIRA)
2017-07-17 08:08:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16089462#comment-16089462 ]

Matthias Müller edited comment on MASSEMBLY-675 at 7/17/17 8:07 AM:
--------------------------------------------------------------------

Is there any chance to get this fixed? From the unresolved tickets in this project, it's the one with the most votes...


was (Author: matthias_82):
Is there any chance to get this fixed? It's one of the top-10 voted tickts for this project...
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: John Casey
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
Rodrigo Carvalho Silva (JIRA)
2017-12-06 16:56:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16280495#comment-16280495 ]

Rodrigo Carvalho Silva commented on MASSEMBLY-675:
--------------------------------------------------

I lost one day of work trying to figure out why my package was being created with undesired dependencies...

Is this issue difficult to be fixed by someone with no experience with the the plugin's codebase (like me)?
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: John Casey
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
Michael Osipov (JIRA)
2017-12-06 17:27:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov reassigned MASSEMBLY-675:
----------------------------------------

Assignee: (was: John Casey)
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
Michael Osipov (JIRA)
2017-12-06 17:28:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16280545#comment-16280545 ]

Michael Osipov commented on MASSEMBLY-675:
------------------------------------------

It is likely to be the complexity. In some cases I have spend days to trace an issue down which was spread through several components. If you want to give it a try...
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
ASF GitHub Bot (JIRA)
2018-02-02 19:02:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16350811#comment-16350811 ]

ASF GitHub Bot commented on MASSEMBLY-675:
------------------------------------------

hbfernandes opened a new pull request #2: [MASSEMBLY-675] Require maven to solve dependencies instead of buildi…
URL: https://github.com/apache/maven-assembly-plugin/pull/2


This seems to fix the wildcard exclusion issue, however there might be side effects i'm not aware of. My knowledge of maven plugins isn't that extensive so any feedback would be appreciated.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Priority: Major
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
ASF GitHub Bot (JIRA)
2018-02-20 16:52:02 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16370251#comment-16370251 ]

ASF GitHub Bot commented on MASSEMBLY-675:
------------------------------------------

asfgit closed pull request #2: [MASSEMBLY-675] Require maven to solve dependencies instead of buildi…
URL: https://github.com/apache/maven-assembly-plugin/pull/2




This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/main/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolver.java b/src/main/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolver.java
index 741b19d8..936e250d 100644
--- a/src/main/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolver.java
+++ b/src/main/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolver.java
@@ -20,20 +20,14 @@
*/

import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
-import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.plugins.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugins.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugins.assembly.archive.phase.ModuleSetAssemblyPhase;
@@ -49,7 +43,6 @@
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter;
-import org.apache.maven.shared.artifact.filter.resolve.transform.ArtifactIncludeFilterTransformer;
import org.apache.maven.shared.artifact.resolve.ArtifactResult;
import org.apache.maven.shared.dependencies.resolve.DependencyResolverException;
import org.codehaus.plexus.component.annotations.Component;
@@ -93,43 +86,28 @@
currentProject );
updateModuleSetResolutionRequirements( assemblyId, moduleSet, dependencySet, info, configSource );

- resolve( assembly, configSource, result, dependencySet, info );
+ result.put( dependencySet, resolve( info, currentProject ) );

}
return result;
}

- private void resolve( Assembly assembly, AssemblerConfigurationSource configSource,
- Map<DependencySet, Set<Artifact>> result, DependencySet dependencySet,
- ResolutionManagementInfo info )
- throws DependencyResolutionException
+ private Set<Artifact> resolve( ResolutionManagementInfo info, MavenProject project )
{
- Set<Artifact> artifacts;
- if ( info.isResolutionRequired() )
+ Set<Artifact> artifacts = new HashSet<>();
+ if ( info.isResolvedTransitively() )
{
- final List<ArtifactRepository> repos =
- aggregateRemoteArtifactRepositories( configSource.getRemoteRepositories(), info.getEnabledProjects() );
-
- artifacts = info.getArtifacts();
- if ( info.isResolvedTransitively() )
- {
- getLogger().debug( "Resolving project dependencies transitively." );
-
- ArtifactFilter filter = new ArtifactIncludeFilterTransformer().transform( info.getScopeFilter() );
- artifacts = resolveTransitively( artifacts, repos, filter, configSource );
- }
- else
- {
- getLogger().debug( "Resolving project dependencies ONLY. "
- + "Transitive dependencies WILL NOT be included in the results." );
- artifacts = resolveNonTransitively( assembly, artifacts, configSource, repos );
- }
+ getLogger().debug( "Resolving project dependencies transitively." );
+ artifacts = project.getArtifacts();
}
else
{
- artifacts = new HashSet<Artifact>();
+ getLogger().debug( "Resolving project dependencies ONLY. "
+ + "Transitive dependencies WILL NOT be included in the results." );
+ artifacts = project.getDependencyArtifacts();
}
- result.put( dependencySet, artifacts );
+
+ return artifacts;
}

@Override
@@ -152,114 +130,29 @@ private void resolve( Assembly assembly, AssemblerConfigurationSource configSour
configSource.getMavenSession().getProjectBuildingRequest(),
currentProject );

- resolve( assembly, configSource, result, dependencySet, info );
+ result.put( dependencySet, resolve( info, currentProject ) );

}
return result;
}

- Set<Artifact> resolveNonTransitively( final Assembly assembly, final Set<Artifact> dependencyArtifacts,
- final AssemblerConfigurationSource configSource,
- final List<ArtifactRepository> repos )
- throws DependencyResolutionException
- {
-
- final List<Artifact> missing = new ArrayList<Artifact>();
- final Set<Artifact> resolved = new LinkedHashSet<Artifact>();
- for ( final Artifact depArtifact : dependencyArtifacts )
- {
- ArtifactResolutionRequest req = new ArtifactResolutionRequest();
- req.setLocalRepository( configSource.getLocalRepository() );
- req.setRemoteRepositories( repos );
- req.setArtifact( depArtifact );
-
- ArtifactResolutionResult resolve = resolver.resolve( req );
- if ( resolve.hasExceptions() )
- {
- if ( getLogger().isDebugEnabled() )
- {
- getLogger().debug(
- "Failed to resolve: " + depArtifact.getId() + " for assembly: " + assembly.getId() );
- }
- missing.add( depArtifact );
- }
- else
- {
- resolved.add( depArtifact );
- }
- }
-
- if ( !missing.isEmpty() )
-
- {
- final MavenProject project = configSource.getProject();
- final Artifact rootArtifact = project.getArtifact();
-
- final Throwable error =
- new MultipleArtifactsNotFoundException( rootArtifact, new ArrayList<Artifact>( resolved ), missing,
- repos );
-
- throw new DependencyResolutionException( "Failed to resolve dependencies for: " + assembly.getId(), error );
- }
-
- return resolved;
- }
-
- private Set<Artifact> resolveTransitively( final Set<Artifact> dependencyArtifacts,
- final List<ArtifactRepository> repos,
- final ArtifactFilter filter,
- final AssemblerConfigurationSource configSource )
- throws DependencyResolutionException
- {
- final MavenProject project = configSource.getProject();
-
- ArtifactResolutionRequest req = new ArtifactResolutionRequest();
- req.setLocalRepository( configSource.getLocalRepository() );
- req.setResolveRoot( false );
- req.setRemoteRepositories( repos );
- req.setResolveTransitively( true );
- req.setArtifact( project.getArtifact() );
- req.setArtifactDependencies( dependencyArtifacts );
- req.setManagedVersionMap( project.getManagedVersionMap() );
- req.setCollectionFilter( filter );
- req.setOffline( configSource.getMavenSession().isOffline() );
- req.setForceUpdate( configSource.getMavenSession().getRequest().isUpdateSnapshots() );
- req.setServers( configSource.getMavenSession().getRequest().getServers() );
- req.setMirrors( configSource.getMavenSession().getRequest().getMirrors() );
- req.setProxies( configSource.getMavenSession().getRequest().getProxies() );
-
- ArtifactResolutionResult result;
-
- result = resolver.resolve( req );
- if ( result.hasExceptions() )
- {
- throw new DependencyResolutionException( "Failed to resolve dependencies for assembly: ",
- result.getExceptions().get( 0 ) );
- }
-
- getLogger().debug( "While resolving dependencies of " + project.getId() + ":" );
-
- FilterUtils.reportFilteringStatistics( Collections.singleton( filter ), getLogger() );
-
- return result.getArtifacts();
- }

void updateRepositoryResolutionRequirements( final Assembly assembly, final ResolutionManagementInfo requirements )
{
final List<Repository> repositories = assembly.getRepositories();

Set<String> rootScopes = new HashSet<String>();
-
+
if ( repositories != null && !repositories.isEmpty() )
{
-
+
requirements.setResolutionRequired( true );
for ( final Repository repo : repositories )
{
rootScopes.add( repo.getScope() );
}
}
-
+
requirements.setScopeFilter( FilterUtils.newScopeFilter( rootScopes ) );
}

@@ -321,9 +214,9 @@ void updateDependencySetResolutionRequirements( final DependencySet set,
requirements.setResolvedTransitively( set.isUseTransitiveDependencies() );

ScopeFilter scopeFilter = FilterUtils.newScopeFilter( set.getScope() );
-
+
requirements.setScopeFilter( scopeFilter );
-
+
for ( final MavenProject project : projects )
{
if ( project == null )
diff --git a/src/main/java/org/apache/maven/plugins/assembly/mojos/SingleAssemblyMojo.java b/src/main/java/org/apache/maven/plugins/assembly/mojos/SingleAssemblyMojo.java
index 1d8d8435..2e33b908 100644
--- a/src/main/java/org/apache/maven/plugins/assembly/mojos/SingleAssemblyMojo.java
+++ b/src/main/java/org/apache/maven/plugins/assembly/mojos/SingleAssemblyMojo.java
@@ -41,7 +41,7 @@
* @author <a href="mailto:***@apache.org">Brett Porter</a>
* @version $Id$
*/
-@Mojo( name = "single", inheritByDefault = false, requiresDependencyResolution = ResolutionScope.COMPILE,
+@Mojo( name = "single", inheritByDefault = false, requiresDependencyResolution = ResolutionScope.TEST,
threadSafe = true )
public class SingleAssemblyMojo
extends AbstractAssemblyMojo




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Priority: Major
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Guillaume Boué (JIRA)
2018-02-20 17:01:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16370263#comment-16370263 ]

Guillaume Boué commented on MASSEMBLY-675:
------------------------------------------

Fixed with initial PR in [b0cf85db9c466d42a4d39f46634ad49cbb784d8c|https://gitbox.apache.org/repos/asf?p=maven-assembly-plugin.git;a=commit;h=b0cf85db9c466d42a4d39f46634ad49cbb784d8c] and additional [78faddf88b1537bc5c61ba74cdb2b227416152b6|https://gitbox.apache.org/repos/asf?p=maven-assembly-plugin.git;a=commit;h=78faddf88b1537bc5c61ba74cdb2b227416152b6].
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Guillaume Boué (JIRA)
2018-02-20 17:01:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Boué closed MASSEMBLY-675.
------------------------------------
Resolution: Fixed
Assignee: Guillaume Boué
Fix Version/s: 3.1.1
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: Guillaume Boué
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Hudson (JIRA)
2018-02-20 17:12:02 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16370290#comment-16370290 ]

Hudson commented on MASSEMBLY-675:
----------------------------------

Build succeeded in Jenkins: Maven TLP » maven-assembly-plugin » master #5

See https://builds.apache.org/job/maven-box/job/maven-assembly-plugin/job/master/5/
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: Guillaume Boué
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Leonid Rozenblyum (JIRA)
2018-04-16 19:03:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439873#comment-16439873 ]

Leonid Rozenblyum commented on MASSEMBLY-675:
---------------------------------------------

Great fix! For me it also fixed https://issues.apache.org/jira/browse/MASSEMBLY-850
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: Guillaume Boué
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Leonid Rozenblyum (JIRA)
2018-04-16 19:04:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439879#comment-16439879 ]

Leonid Rozenblyum commented on MASSEMBLY-675:
---------------------------------------------

Could a new release of maven-assembly-plugin be created with the fix (since it fixes actually 2 problems)? I'd appreciate that.

Thanks! [~gboue]
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: Guillaume Boué
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Tomer Cohen (JIRA)
2018-06-28 00:19:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16525763#comment-16525763 ]

Tomer Cohen commented on MASSEMBLY-675:
---------------------------------------

Any ETA on when this version will be released?
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: Guillaume Boué
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Falko Modler (JIRA)
2018-12-06 23:31:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16712145#comment-16712145 ]

Falko Modler commented on MASSEMBLY-675:
----------------------------------------

This fix also improves runtime dramatically when you have many dependencies and {{<useTransitiveDependencies>true</useTransitiveDependencies>}}!

Can you please release 3.1.1, [~olamy] / [~hboutemy] / [~rfscholte] / [~khmarbaise]? Thanks!
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: Guillaume Boué
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Robert Scholte (JIRA)
2018-12-09 10:08:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte updated MASSEMBLY-675:
-------------------------------------
Description:
Version 2.4 ignores wildcard exclusions in POM dependencies

Example (perhaps contrived - but easy to setup):

When a pom declares a dependency such as closure-compiler and for some reason we do not want to pull its dependencies in we could declare this in our POM, without having to know what those dependencies are:

{code:xml}
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
{code}

This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], MNG-3832. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
Here is the assembly descriptor:

{code:xml}
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
{code}
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!

Steps to reproduce are:
{noformat}
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
{noformat}
*Notice that the excluded jars are included in the assembly*

I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar

was:
Version 2.4 ignores wildcard exclusions in POM dependencies

Example (perhaps contrived - but easy to setup):

When a pom declares a dependency such as closure-compiler and for some reason we do not want to pull its dependencies in we could declare this in our POM, without having to know what those dependencies are:

<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], [MNG-3832|https://jira.codehaus.org/browse/MNG-3832]. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
Here is the assembly descriptor:

<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>

We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!

Steps to reproduce are:

$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar

*Notice that the excluded jars are included in the assembly*

I would expect to only see the following JARs.

* closure-compiler-v20131014.jar
* massembly-675-1.jar
Maven Assembly packaging wildcard-excluded dependencies
-------------------------------------------------------
Key: MASSEMBLY-675
URL: https://issues.apache.org/jira/browse/MASSEMBLY-675
Project: Maven Assembly Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Apache Maven 3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
Reporter: Frank Wilson
Assignee: Guillaume Boué
Priority: Major
Fix For: 3.1.1
Attachments: massembly-675.zip
Version 2.4 ignores wildcard exclusions in POM dependencies
{code:xml}
<dependencies>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20131014</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
{code}
This is a valid use of the exclusion feature as per [Maven Confluence|http://docs.codehaus.org/display/MAVENUSER/wildcard+exclusion+for+artifact+dependencies], MNG-3832. False warning about wildcards were [fixed|https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=65c135d5] in Git about 10 days ago
{code:xml}
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet/>
</dependencySets>
</assembly>
{code}
We expect to only find the current project artifact and the closure-compiler JAR in our directory assembly. However the assembly plugin ignores our POM directive and includes the closure-compilers dependencies anyway!
{noformat}
$ unzip massembly-675.zip
$ cd massembly-675
$ mvn clean install
$ ls target/massembly-675-1-bin
args4j-2.0.16.jar json-20090211.jar protobuf-java-2.4.1.jar
closure-compiler-v20131014.jar jsr305-1.3.9.jar
guava-15.0.jar massembly-675-1.jar
{noformat}
*Notice that the excluded jars are included in the assembly*
I would expect to only see the following JARs.
* closure-compiler-v20131014.jar
* massembly-675-1.jar
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Loading...