You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andreas Sewe <se...@st.informatik.tu-darmstadt.de> on 2010/07/01 18:56:23 UTC

Maven-assembly-plugin: How to make the assembly the primary artifact

Hi all,

I have a project which should produce a ZIP, with all contents of 
${project.build.outputDirect} put into a base directory within the ZIP. 
So far, the maven-assembly-plugin with <includeBaseDirectory> fits the 
bill perfectly.

There is one issue, however, which I haven't been able to solve: I can't 
get the plugin to make the produced assembly the *primary* artifact. 
(There is only a single assembly per project produced this way.)

Is this possible? Or is there another plugin which I can resort to? (The 
  org.apache.maven.plugins:maven-zip-plugin does almost what I want, but 
seems to be not longer supported in favour of the 
maven-assembly-plugin.) Any suggestions?

Best wishes,

Andreas

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


Re: Maven-assembly-plugin: How to make the assembly the primary artifact

Posted by Anders Hammar <an...@hammar.net>.
I'm with Tamás here. Having something that works, is not always the correct
solution...

/Anders

2010/7/1 Tamás Cservenák <ta...@cservenak.net>

> While Kalle's solution will do the work, I can't emphasize how this
> approach
> is wrong, at least I think it is.
>
> For situations like this, a custom plugin (or better, custom packaging)
> would be the best, since this solution will produce inconsistent data:
>
> Deployed POM will have packaging "pom", and that packaging has nothing to
> do
> with ZIP as primary artifact. But it's only me ;)
>
>
> Thanks,
> ~t~
>
> On Thu, Jul 1, 2010 at 8:09 PM, Kalle Korhonen
> <ka...@gmail.com>wrote:
>
> > The pom artifact is always produced regardless. Make your module type
> > pom and attach the assembly zip as an artifact with the help of
> > buildhelper plugin:
> > http://mojo.codehaus.org/build-helper-maven-plugin/usage.html.
> >
> > Kalle
> >
> >
> > On Thu, Jul 1, 2010 at 9:56 AM, Andreas Sewe
> > <se...@st.informatik.tu-darmstadt.de> wrote:
> > > Hi all,
> > >
> > > I have a project which should produce a ZIP, with all contents of
> > > ${project.build.outputDirect} put into a base directory within the ZIP.
> > So
> > > far, the maven-assembly-plugin with <includeBaseDirectory> fits the
> bill
> > > perfectly.
> > >
> > > There is one issue, however, which I haven't been able to solve: I
> can't
> > get
> > > the plugin to make the produced assembly the *primary* artifact. (There
> > is
> > > only a single assembly per project produced this way.)
> > >
> > > Is this possible? Or is there another plugin which I can resort to?
> (The
> > >  org.apache.maven.plugins:maven-zip-plugin does almost what I want, but
> > > seems to be not longer supported in favour of the
> maven-assembly-plugin.)
> > > Any suggestions?
> > >
> > > Best wishes,
> > >
> > > Andreas
> > >
> > > ---------------------------------------------------------------------
> > > 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: Maven-assembly-plugin: How to make the assembly the primary artifact

Posted by Tamás Cservenák <ta...@cservenak.net>.
While Kalle's solution will do the work, I can't emphasize how this approach
is wrong, at least I think it is.

For situations like this, a custom plugin (or better, custom packaging)
would be the best, since this solution will produce inconsistent data:

Deployed POM will have packaging "pom", and that packaging has nothing to do
with ZIP as primary artifact. But it's only me ;)


Thanks,
~t~

On Thu, Jul 1, 2010 at 8:09 PM, Kalle Korhonen
<ka...@gmail.com>wrote:

> The pom artifact is always produced regardless. Make your module type
> pom and attach the assembly zip as an artifact with the help of
> buildhelper plugin:
> http://mojo.codehaus.org/build-helper-maven-plugin/usage.html.
>
> Kalle
>
>
> On Thu, Jul 1, 2010 at 9:56 AM, Andreas Sewe
> <se...@st.informatik.tu-darmstadt.de> wrote:
> > Hi all,
> >
> > I have a project which should produce a ZIP, with all contents of
> > ${project.build.outputDirect} put into a base directory within the ZIP.
> So
> > far, the maven-assembly-plugin with <includeBaseDirectory> fits the bill
> > perfectly.
> >
> > There is one issue, however, which I haven't been able to solve: I can't
> get
> > the plugin to make the produced assembly the *primary* artifact. (There
> is
> > only a single assembly per project produced this way.)
> >
> > Is this possible? Or is there another plugin which I can resort to? (The
> >  org.apache.maven.plugins:maven-zip-plugin does almost what I want, but
> > seems to be not longer supported in favour of the maven-assembly-plugin.)
> > Any suggestions?
> >
> > Best wishes,
> >
> > Andreas
> >
> > ---------------------------------------------------------------------
> > 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: Maven-assembly-plugin: How to make the assembly the primary artifact

Posted by Kalle Korhonen <ka...@gmail.com>.
The pom artifact is always produced regardless. Make your module type
pom and attach the assembly zip as an artifact with the help of
buildhelper plugin:
http://mojo.codehaus.org/build-helper-maven-plugin/usage.html.

Kalle


On Thu, Jul 1, 2010 at 9:56 AM, Andreas Sewe
<se...@st.informatik.tu-darmstadt.de> wrote:
> Hi all,
>
> I have a project which should produce a ZIP, with all contents of
> ${project.build.outputDirect} put into a base directory within the ZIP. So
> far, the maven-assembly-plugin with <includeBaseDirectory> fits the bill
> perfectly.
>
> There is one issue, however, which I haven't been able to solve: I can't get
> the plugin to make the produced assembly the *primary* artifact. (There is
> only a single assembly per project produced this way.)
>
> Is this possible? Or is there another plugin which I can resort to? (The
>  org.apache.maven.plugins:maven-zip-plugin does almost what I want, but
> seems to be not longer supported in favour of the maven-assembly-plugin.)
> Any suggestions?
>
> Best wishes,
>
> Andreas
>
> ---------------------------------------------------------------------
> 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