[ 
https://jira.codehaus.org/browse/MDEP-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=348608#comment-348608
 ] 

Alejandro E commented on MDEP-182:
----------------------------------

I would like to propose re-opening this bug. There is a use case that isn't 
covered with copy-dependencies

I need to copy two versions of the same artifact. So i have v 1.0.0 in the 
dependencies section but i cannot have also v2.0.0 in the dependency section 
since maven will ignore one of them. I added the second version in the goal of 
a "copy" execution in an <artifactItem> and was hoping that its transitive 
dependencies would be copied, which is not the case. This use-case of having 
more than one version at runtime is possible and very common in osgi 
environments

> Add exclude*,  parameters to copy mojo (analogous to copy-dependencies mojo)
> ----------------------------------------------------------------------------
>
>                 Key: MDEP-182
>                 URL: https://jira.codehaus.org/browse/MDEP-182
>             Project: Maven Dependency Plugin
>          Issue Type: New Feature
>          Components: copy
>    Affects Versions: 2.1
>            Reporter: Thorsten Möller
>            Assignee: brianfox brianfox
>
> Today I came around a use case that I miss in the copy goal/mojo of the 
> dependency plugin. Currently, it is not possible (at least I could not find 
> any documentation) to resolve transitive dependencies when copying an 
> artifact nor to specify whether transitive dependencies should be included or 
> excluded. This should be extended analogous to the copy-dependencies mojo.
> Example: Say we want to copy Retrotranslator including its dependencies. 
> Currently we would have to use the following declarations
> <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-dependency-plugin</artifactId>
>       <executions>
>               <execution>
>                       <id>copy</id>
>                       <phase>package</phase>
>                       <goals>
>                               <goal>copy</goal>
>                       </goals>
>                       <configuration>
>                               <artifactItems>
>                                       <artifactItem>
>                                               
> <groupId>net.sf.retrotranslator</groupId>
>                                               
> <artifactId>retrotranslator-runtime</artifactId>
>                                               
> <version>${retrotranslator-version}</version>
>                                               <type>jar</type>
>                                               
> <outputDirectory>${project.build.directory}</outputDirectory>
>                                       </artifactItem>
>                                       <!-- Transitive dependency of 
> Retrotranslator. Unfortunately, not automatically included. -->
>                                       <artifactItem>
>                                               
> <groupId>backport-util-concurrent</groupId>
>                                               
> <artifactId>backport-util-concurrent</artifactId>
>                                               <version>3.1</version>
>                                               <type>jar</type>
>                                               
> <outputDirectory>${project.build.directory}</outputDirectory>
>                                       </artifactItem>
>                               </artifactItems>
>                       </configuration>
>               </execution>
>       </executions>
> </plugin>
> This has the downside that all dependencies must be explicitly listed and 
> artifact versions must be kept consistent, which is "unwished maintenance 
> work". More convenient would be a declaration as follows
> <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-dependency-plugin</artifactId>
>       <executions>
>               <execution>
>                       <id>copy</id>
>                       <phase>package</phase>
>                       <goals>
>                               <goal>copy</goal>
>                       </goals>
>                       <configuration>
>                               <artifactItems>
>                                       <artifactItem>
>                                               
> <groupId>net.sf.retrotranslator</groupId>
>                                               
> <artifactId>retrotranslator-runtime</artifactId>
>                                               
> <version>${retrotranslator-version}</version>
>                                               <type>jar</type>
>                                               
> <outputDirectory>${project.build.directory}</outputDirectory>
>                                               <!-- Force to include *all* 
> transitive dependencies. They should be copied to the same output directory. 
> -->
>                                               
> <excludeTransitive>false</excludeTransitive>
>                                       </artifactItem>
>                               </artifactItems>
>                       </configuration>
>               </execution>
>       </executions>
> </plugin>



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to