You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Billy Newman <ne...@gmail.com> on 2012/11/01 22:48:01 UTC

Include child binaries in a assembly distribution

I am having problems trying to assemble all of my child binaries from the
main parent pom when using the maven-assembly plugin.

I have read:
https://maven.apache.org/plugins/maven-assembly-plugin/faq.html#module-binaries

I can create a child project with the sole intent is to create a
distribution of the entire project, yet seems like a hack.  Any other work
arounds/ideas that anyone has come up with to solve this problem?

Thanks.

Re: Include child binaries in a assembly distribution

Posted by Wayne Fay <wa...@gmail.com>.
> distribution.  I am guessing this is due to the module 3 pom not
> really creating a maven artifact like a jar/war/ear, but instead it
> creates a zip.
>
> Is there anyway from my child distribution pom/assembly to include the
> zip archive that was created as part of the module 3 build?

Most likely you are not using the assembly plugin correctly so the ZIP
artifact is not "bound" to the build. You need to ensure the ZIP
artifact in module3 is being installed into the local repo cache when
you are in that project directory and type "mvn install". Also, you
should be using the "single" goal of the assembly plugin.

This may be important for you, from the FAQ:
Can I use an artifact created by the assembly plugin as a dependency?
Yes. You can refer to it using the id of the assembly as the
dependency classifier.
http://maven.apache.org/plugins/maven-assembly-plugin/faq.html

Then you need to check how you are depending on that artifact in dist.
You will need to declare <type>zip</type> in the dependency.

Here's more info that may be helpful:
http://www.sonatype.com/books/mvnref-book/reference/assemblies-sect-controlling-contents.html

Wayne

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


Re: Include child binaries in a assembly distribution

Posted by Billy Newman <ne...@gmail.com>.
Any ideas?

On Thu, Nov 8, 2012 at 12:40 PM, Billy Newman <ne...@gmail.com> wrote:
> Almost there getting a final distribution build.  I am having one last
> problem that I am not sure how to solve:
>
> Project layout
> -->module 1 (jar)
> -->module 2 (war)
> -->module 3 (zip) This module builds a zip archive using the assmebly plugin
> --> dist module Module to create distribution
> pom.xml
>
> My problem is that my module 3 (which is a pom artifact that creates a
> zip file using the assembly plugin) is not included in my
> distribution.  I am guessing this is due to the module 3 pom not
> really creating a maven artifact like a jar/war/ear, but instead it
> creates a zip.
>
> Is there anyway from my child distribution pom/assembly to include the
> zip archive that was created as part of the module 3 build?
>
> Thanks.
>
> On Fri, Nov 2, 2012 at 9:01 AM, Billy Newman <ne...@gmail.com> wrote:
>> So I am following:
>> http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-binary-inclusion-simple.html
>>
>> Seems pretty straight forward.  I have create a child module (put it at the
>> end of the module list in the parent), but I am getting this error:
>>
>> 'The following patterns were never triggered in this artifact inclusion
>> filter
>> o org.test:child1'.
>>
>> Been staring at this for a while and I have no idea what is wrong.
>>
>> I have double checked that I included the org.test:child1 artifact in the
>> child distribution build. And I have also verified that I am using:
>>
>>       <!-- Enable access to all projects in the current multimodule build!
>> -->
>>       <useAllReactorProjects>true</useAllReactorProjects>
>>
>> Any ideas?
>>
>> Thanks,
>> Billy
>>
>>
>>
>>
>> On Thu, Nov 1, 2012 at 9:05 PM, Srinath C <sr...@gmail.com> wrote:
>>>
>>> Hi Billy,
>>>
>>> +1 to the way Anders suggested.
>>> I had once implemented the assembling exactly the way you did, but then
>>> ran
>>> into issues and had to switch to having a sub-module do the assembling.
>>>
>>> Regards
>>> Srinath.
>>>
>>> On Fri, Nov 2, 2012 at 6:10 AM, Wayne Fay <wa...@gmail.com> wrote:
>>>
>>> > > Could I get away with attaching the assembly to a different phase
>>> > > (after
>>> > > package) that would ensure my child modules have gone through the
>>> > > package
>>> > > phase.  Then pull the binaries from the target dir of each child?
>>> >
>>> > Why would you want to? Anders told the "right" way to do this.
>>> >
>>> > Wayne
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> > For additional commands, e-mail: users-help@maven.apache.org
>>> >
>>> >
>>
>>

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


Re: Include child binaries in a assembly distribution

Posted by Billy Newman <ne...@gmail.com>.
Almost there getting a final distribution build.  I am having one last
problem that I am not sure how to solve:

Project layout
-->module 1 (jar)
-->module 2 (war)
-->module 3 (zip) This module builds a zip archive using the assmebly plugin
--> dist module Module to create distribution
pom.xml

My problem is that my module 3 (which is a pom artifact that creates a
zip file using the assembly plugin) is not included in my
distribution.  I am guessing this is due to the module 3 pom not
really creating a maven artifact like a jar/war/ear, but instead it
creates a zip.

Is there anyway from my child distribution pom/assembly to include the
zip archive that was created as part of the module 3 build?

Thanks.

On Fri, Nov 2, 2012 at 9:01 AM, Billy Newman <ne...@gmail.com> wrote:
> So I am following:
> http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-binary-inclusion-simple.html
>
> Seems pretty straight forward.  I have create a child module (put it at the
> end of the module list in the parent), but I am getting this error:
>
> 'The following patterns were never triggered in this artifact inclusion
> filter
> o org.test:child1'.
>
> Been staring at this for a while and I have no idea what is wrong.
>
> I have double checked that I included the org.test:child1 artifact in the
> child distribution build. And I have also verified that I am using:
>
>       <!-- Enable access to all projects in the current multimodule build!
> -->
>       <useAllReactorProjects>true</useAllReactorProjects>
>
> Any ideas?
>
> Thanks,
> Billy
>
>
>
>
> On Thu, Nov 1, 2012 at 9:05 PM, Srinath C <sr...@gmail.com> wrote:
>>
>> Hi Billy,
>>
>> +1 to the way Anders suggested.
>> I had once implemented the assembling exactly the way you did, but then
>> ran
>> into issues and had to switch to having a sub-module do the assembling.
>>
>> Regards
>> Srinath.
>>
>> On Fri, Nov 2, 2012 at 6:10 AM, Wayne Fay <wa...@gmail.com> wrote:
>>
>> > > Could I get away with attaching the assembly to a different phase
>> > > (after
>> > > package) that would ensure my child modules have gone through the
>> > > package
>> > > phase.  Then pull the binaries from the target dir of each child?
>> >
>> > Why would you want to? Anders told the "right" way to do this.
>> >
>> > Wayne
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>
>

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


Re: Include child binaries in a assembly distribution

Posted by Billy Newman <ne...@gmail.com>.
So I am following:
http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-binary-inclusion-simple.html

Seems pretty straight forward.  I have create a child module (put it at the
end of the module list in the parent), but I am getting this error:

'The following patterns were never triggered in this artifact inclusion
filter
o org.test:child1'.

Been staring at this for a while and I have no idea what is wrong.

I have double checked that I included the org.test:child1 artifact in the
child distribution build. And I have also verified that I am using:

      <!-- Enable access to all projects in the current multimodule build! -->
      <useAllReactorProjects>true</useAllReactorProjects>

Any ideas?

Thanks,
Billy




On Thu, Nov 1, 2012 at 9:05 PM, Srinath C <sr...@gmail.com> wrote:

> Hi Billy,
>
> +1 to the way Anders suggested.
> I had once implemented the assembling exactly the way you did, but then ran
> into issues and had to switch to having a sub-module do the assembling.
>
> Regards
> Srinath.
>
> On Fri, Nov 2, 2012 at 6:10 AM, Wayne Fay <wa...@gmail.com> wrote:
>
> > > Could I get away with attaching the assembly to a different phase
> (after
> > > package) that would ensure my child modules have gone through the
> package
> > > phase.  Then pull the binaries from the target dir of each child?
> >
> > Why would you want to? Anders told the "right" way to do this.
> >
> > Wayne
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Include child binaries in a assembly distribution

Posted by Srinath C <sr...@gmail.com>.
Hi Billy,

+1 to the way Anders suggested.
I had once implemented the assembling exactly the way you did, but then ran
into issues and had to switch to having a sub-module do the assembling.

Regards
Srinath.

On Fri, Nov 2, 2012 at 6:10 AM, Wayne Fay <wa...@gmail.com> wrote:

> > Could I get away with attaching the assembly to a different phase (after
> > package) that would ensure my child modules have gone through the package
> > phase.  Then pull the binaries from the target dir of each child?
>
> Why would you want to? Anders told the "right" way to do this.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Include child binaries in a assembly distribution

Posted by Wayne Fay <wa...@gmail.com>.
> Could I get away with attaching the assembly to a different phase (after
> package) that would ensure my child modules have gone through the package
> phase.  Then pull the binaries from the target dir of each child?

Why would you want to? Anders told the "right" way to do this.

Wayne

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


Re: Include child binaries in a assembly distribution

Posted by Billy Newman <ne...@gmail.com>.
Could I get away with attaching the assembly to a different phase (after
package) that would ensure my child modules have gone through the package
phase.  Then pull the binaries from the target dir of each child?

Billy


On Thu, Nov 1, 2012 at 4:26 PM, Anders Hammar <an...@hammar.net> wrote:

> > I can create a child project with the sole intent is to create a
> > distribution of the entire project, yet seems like a hack.
>
>
> It's not a hack but the Maven way of doing this. Doing the assembling in
> the parent pom requires some hacky solutions to work (as the parent needs
> to be built before the children as they depend on the parent, but yet you
> want the assembling to be done in the end). Which the FAQ you refer to
> talks about.
>
> /Anders
>
>
> > Any other work
> > arounds/ideas that anyone has come up with to solve this problem?
> >
> > Thanks.
> >
>

Re: Include child binaries in a assembly distribution

Posted by Anders Hammar <an...@hammar.net>.
> I can create a child project with the sole intent is to create a
> distribution of the entire project, yet seems like a hack.


It's not a hack but the Maven way of doing this. Doing the assembling in
the parent pom requires some hacky solutions to work (as the parent needs
to be built before the children as they depend on the parent, but yet you
want the assembling to be done in the end). Which the FAQ you refer to
talks about.

/Anders


> Any other work
> arounds/ideas that anyone has come up with to solve this problem?
>
> Thanks.
>