maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Wilson (JIRA)" <j...@codehaus.org>
Subject [jira] (MASSEMBLY-675) Maven Assembly packaging excluded dependencies
Date Mon, 02 Dec 2013 18:14:45 GMT

     [ https://jira.codehaus.org/browse/MASSEMBLY-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Frank Wilson 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:

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

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

  was:
Version 2.4 is affected by the same issue as MASSEMBLY-444 reported on version 2.2.

The maven assembly plugin seem to be ignoring dependencies that have been listed in the exclude
section of the pom.  This seems to be the same as http://jira.codehaus.org/browse/MASSEMBLY-236
which appears to have been closed without resolution:

Example:

When a pom declares a dependency such as log4j which has dependencies that are not in the
maven repository (or simply undesired), one can add them to the exclusion listing... however
the maven-assembly-plugin seems to be ignoring them when running a dir-type assembly task.

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

Here is the assembly descriptor:

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

I am an updated version of the test case.

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 excluded dependencies
> ----------------------------------------------
>
>                 Key: MASSEMBLY-675
>                 URL: https://jira.codehaus.org/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
>
> 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>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message