You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Simon Temple <si...@amalto.com> on 2012/09/17 17:15:01 UTC

maven-assembly-plugin 2.3 and parent pom

Hi

I'm trying to use the assembly plugin to build a product distribution.  I include a parent POM declaration in my POM.  The parent POM has many dependencies (mixed scope: compile, provided and test)

When I execute make-assembly the resulting distribution does not contain the dependent artifacts defined in my parent POM.

Looking at the  'effective POM' I can see the parent POM dependencies, yet the assembly plugin does not include them in the distribution.

Is this a bug in the assembly-plugin or am I doing something wrong?

assembly.xml:

<assembly

    <id>distro</id>
    
    <formats>
        <format>dir</format>
    </formats>
    
    <includeBaseDirectory>false</includeBaseDirectory>
    
    <fileSets>
        <fileSet>
            <directory>src/main/resources</directory>
            <outputDirectory>/</outputDirectory>
        </fileSet>
    </fileSets>

    <dependencySets>
        <dependencySet>
            <outputDirectory>/lib</outputDirectory>
        </dependencySet>
    </dependencySets>
    
</assembly>

pom.xml:

<snip>

<parent>
	<artifactId>my-parent.pom</artifactId>
	<groupId>com.name.product</groupId>
	<version>5.0.0-SNAPSHOT</version>
</parent>

<snip>

If I explicitly add dependencies to my POM then the assembly plugin correctly adds them to the lib folder of my distribution.


TIA



Simon Temple






Re: maven-assembly-plugin 2.3 and parent pom

Posted by Simon Temple <si...@amalto.com>.
That's it…thanks for getting me to think about what I'm doing!

The <dependencyManagment>/<dependencies> section and the <dependencies> section are very different things.

- Simon


On 17 Sep 2012, at 17:03, Ron Wheeler wrote:

> I believe that this is the correct behaviour.
> The Parent pom has a dependencyManagement section where you can put the versions of libraries that you want to use but this does not push dependencies into child POMs.
> This is a good thing since we have about 60 POMs that share a parent and do not want all the dependencies in every jar or war that we make.
> We do want the version of any artifact to be the same in all projects.
> 
> Ron
> 
> On 17/09/2012 11:15 AM, Simon Temple wrote:
>> Hi
>> 
>> I'm trying to use the assembly plugin to build a product distribution.  I include a parent POM declaration in my POM.  The parent POM has many dependencies (mixed scope: compile, provided and test)
>> 
>> When I execute make-assembly the resulting distribution does not contain the dependent artifacts defined in my parent POM.
>> 
>> Looking at the  'effective POM' I can see the parent POM dependencies, yet the assembly plugin does not include them in the distribution.
>> 
>> Is this a bug in the assembly-plugin or am I doing something wrong?
>> 
>> assembly.xml:
>> 
>> <assembly
>> 
>>     <id>distro</id>
>>          <formats>
>>         <format>dir</format>
>>     </formats>
>>          <includeBaseDirectory>false</includeBaseDirectory>
>>          <fileSets>
>>         <fileSet>
>>             <directory>src/main/resources</directory>
>>             <outputDirectory>/</outputDirectory>
>>         </fileSet>
>>     </fileSets>
>> 
>>     <dependencySets>
>>         <dependencySet>
>>             <outputDirectory>/lib</outputDirectory>
>>         </dependencySet>
>>     </dependencySets>
>>     </assembly>
>> 
>> pom.xml:
>> 
>> <snip>
>> 
>> <parent>
>> 	<artifactId>my-parent.pom</artifactId>
>> 	<groupId>com.name.product</groupId>
>> 	<version>5.0.0-SNAPSHOT</version>
>> </parent>
>> 
>> <snip>
>> 
>> If I explicitly add dependencies to my POM then the assembly plugin correctly adds them to the lib folder of my distribution.
>> 
>> 
>> TIA
>> 
>> 
>> 
>> Simon Temple
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 
> -- 
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


Re: maven-assembly-plugin 2.3 and parent pom

Posted by Ron Wheeler <rw...@artifact-software.com>.
I believe that this is the correct behaviour.
The Parent pom has a dependencyManagement section where you can put the 
versions of libraries that you want to use but this does not push 
dependencies into child POMs.
This is a good thing since we have about 60 POMs that share a parent and 
do not want all the dependencies in every jar or war that we make.
We do want the version of any artifact to be the same in all projects.

Ron

On 17/09/2012 11:15 AM, Simon Temple wrote:
> Hi
>
> I'm trying to use the assembly plugin to build a product distribution.  I include a parent POM declaration in my POM.  The parent POM has many dependencies (mixed scope: compile, provided and test)
>
> When I execute make-assembly the resulting distribution does not contain the dependent artifacts defined in my parent POM.
>
> Looking at the  'effective POM' I can see the parent POM dependencies, yet the assembly plugin does not include them in the distribution.
>
> Is this a bug in the assembly-plugin or am I doing something wrong?
>
> assembly.xml:
>
> <assembly
>
>      <id>distro</id>
>      
>      <formats>
>          <format>dir</format>
>      </formats>
>      
>      <includeBaseDirectory>false</includeBaseDirectory>
>      
>      <fileSets>
>          <fileSet>
>              <directory>src/main/resources</directory>
>              <outputDirectory>/</outputDirectory>
>          </fileSet>
>      </fileSets>
>
>      <dependencySets>
>          <dependencySet>
>              <outputDirectory>/lib</outputDirectory>
>          </dependencySet>
>      </dependencySets>
>      
> </assembly>
>
> pom.xml:
>
> <snip>
>
> <parent>
> 	<artifactId>my-parent.pom</artifactId>
> 	<groupId>com.name.product</groupId>
> 	<version>5.0.0-SNAPSHOT</version>
> </parent>
>
> <snip>
>
> If I explicitly add dependencies to my POM then the assembly plugin correctly adds them to the lib folder of my distribution.
>
>
> TIA
>
>
>
> Simon Temple
>
>
>
>
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org