You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christin Wolfram <ch...@panoratio.com> on 2007/04/05 14:38:04 UTC

[m2] assembly: dependencySets - include one artifact with its transitive dependencies?

Hi there,

 

I'm using maven 2.0.6 and maven-assembly-plugin to package some
zip-distributions of my project.

 

Doing that I couldn't find an answer to the following question:

How does the assembly plugin handle includes in dependencySets? What is
the result when I include an artifact that comes with transitive
dependencies? Does it include only the specified artifact or also its
transitive dependencies? 

Or better to say: Is it possible to include only one project dependency
including its transitive deps?

 

I tried this with assemby plugin version 2.1 and 2.2-SNAPSHOT and get
different results. 2.1 only includes the specified artifact and
2.2-SNAPSHOT includes also transitive deps.

 

Can anybody tell me what the general behavior of version 2.2 would be?

 

What I want to do is quiet simply: 

I have two dependencies A and B. Each of them has its own deps that are
now transitive to my project. I want to package dependency A including
its transitive deps in one folder of my zip file and dependency B incl
its dependencies in another folder.

 

Simplified my assembly descriptor has these dependencySets:

<dependencySets>

            <dependencySet>

 
<outputDirectory>/program/lib/A</outputDirectory>

                        <includes>

                                    <include>mygroupid:A</include>

                        </includes>

            </dependencySet>

<dependencySet>

 
<outputDirectory>/program/lib/B</outputDirectory>

                        <includes>

                                    <include>mygroupid:B</include>

                        </includes>

            </dependencySet>

</dependencySets>

 

How to package the transitive Dependencies correctly without writing
large lists of includes or excludes?

 

Thanks,

Christin.


Re: [m2] assembly: dependencySets - include one artifact with its transitive dependencies?

Posted by Kalle Korhonen <ka...@gmail.com>.
On 4/5/07, Christin Wolfram <ch...@panoratio.com> wrote:
>
> I'm using maven 2.0.6 and maven-assembly-plugin to package some
> zip-distributions of my project.
>
> Doing that I couldn't find an answer to the following question:
> How does the assembly plugin handle includes in dependencySets? What is
> the result when I include an artifact that comes with transitive
> dependencies? Does it include only the specified artifact or also its
> transitive dependencies?


I remember it was mentioned somewhere in the docs (but probably not too easy
to find) that includes are matched against each dependency, transitive or
not.

Or better to say: Is it possible to include only one project dependency
> including its transitive deps?
> I tried this with assemby plugin version 2.1 and 2.2-SNAPSHOT and get
> different results. 2.1 only includes the specified artifact and
> 2.2-SNAPSHOT includes also transitive deps.


What you get with the latest 2.2-SNAPSHOT is pretty much what you'll get
with 2.2-beta-1. But at least with some older versions of
2.2-SNAPSHOT(haven't tested with absolute latest) the behavior is
identical and it would
just get what matched the include rule. Having to deal with this
not-necessarily-so-useful feature, what I've resorted to doing in some case
is that I've created a child pom modules under the assembly and declared
just those dependencies in the pom I've needed to deploy to specific
locations, then using moduleSet on them with includeDependencies set to
true.

Hope it helps,
Kalle


What I want to do is quiet simply:
>
> I have two dependencies A and B. Each of them has its own deps that are
> now transitive to my project. I want to package dependency A including
> its transitive deps in one folder of my zip file and dependency B incl
> its dependencies in another folder.
>
>
>
> Simplified my assembly descriptor has these dependencySets:
>
> <dependencySets>
>
>             <dependencySet>
>
>
> <outputDirectory>/program/lib/A</outputDirectory>
>
>                         <includes>
>
>                                     <include>mygroupid:A</include>
>
>                         </includes>
>
>             </dependencySet>
>
> <dependencySet>
>
>
> <outputDirectory>/program/lib/B</outputDirectory>
>
>                         <includes>
>
>                                     <include>mygroupid:B</include>
>
>                         </includes>
>
>             </dependencySet>
>
> </dependencySets>
>
>
>
> How to package the transitive Dependencies correctly without writing
> large lists of includes or excludes?
>
>
>
> Thanks,
>
> Christin.
>
>