You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mick Knutson <mi...@gmail.com> on 2007/06/27 20:13:38 UTC

[m2] more than 1 artifact per pom.xml???

I want to create a war and an ear in one module (pom.xml)

-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

RE: [m2] more than 1 artifact per pom.xml???

Posted by Ryan Nelson <rn...@insight.com>.
I'm a bit of a maven newbie, but I don't think this is even possible.
You can only declare one package type, and you cannot inherit from any
other package type than "pom."  So there'd be no way to inherit from
package type "ear."

Thierry's suggestion is what we've been using, and it's worked well.

Ryan

-----Original Message-----
From: Thierry Lach [mailto:thierry.lach@gmail.com] 
Sent: Wednesday, June 27, 2007 1:30 PM
To: Maven Users List
Subject: Re: [m2] more than 1 artifact per pom.xml???

I don't think that will work.  Maven tends to get confused when one pom
is used to do multiple things, and you'd be trying to make a pom do both
an ear and a module build.  It's tricky to get the correct plugin to
work in the different lifecycles, and even worse to get a plugin NOT to
work in certain lifecycles.

One possiblity that did occur to me would be to use the antrun plugin
and use ant commands to create your ear by binding antrun to the package
phase.
You'd lose the deployment capability though, and IMO it would be much
less maintainable.

On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
>
> Can I do;
>
> ./pom.xml (EAR)
> ./war/pom.xml (WAR) (extends EAR pom)
>
>
> On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
> >
> > That's how I build my J2EE projects, too. I usually have a couple 
> > /jarN and /ejb directories under there too.
> >
> > Wayne
> >
> > On 6/27/07, Thierry Lach <th...@gmail.com> wrote:
> > > I don't know if it would be a best practice, but I've been 
> > > creating
> > projects
> > > that contains 3 poms...
> > >
> > > /pom.xml
> > > /war/pom.xml
> > > /ear/pom.xml
> > >
> > > First pom only references the other two poms as modules.
> > > The entire project can be built from the first pom.
> > >
> > >
> > > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > > >
> > > > I have dozens of web services that are being created as WAR's. 
> > > > For consistency, each WAR that is deployed on seperate machines 
> > > > will be packaged as an EAR. Thus, each war also needed to be 
> > > > packaged into an EAR.
> > > >
> > > > Is there a better more "Best-Practices" way of doing this?
> > > >
> > > >
> > > >
> > > >
> > > > On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
> > > > >
> > > > > Why?? While you might be able to configure this with some 
> > > > > complex
> > pom
> > > > > file, I don't see the point when it is far easier (and 
> > > > > actually
> > > > > supported) to do this in 2 pom.xml files.
> > > > >
> > > > > Wayne
> > > > >
> > > > > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > > > > > I want to create a war and an ear in one module (pom.xml)
> > > > > >
> > > > > > --
> > > > > > ---
> > > > > > Thanks,
> > > > > > Mick Knutson
> > > > > >
> > > > > > http://www.baselogic.com
> > > > > > http://www.blincmagazine.com http://www.djmick.com 
> > > > > > http://www.myspace.com/mickknutson
> > > > > > http://www.myspace.com/djmick_dot_com
> > > > > > http://www.myspace.com/sexybeotches
> > > > > > http://www.thumpradio.com
> > > > > > ---
> > > > > >
> > > > >
> > > > >
> > --------------------------------------------------------------------
> > -
> > > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > ---
> > > > Thanks,
> > > > Mick Knutson
> > > >
> > > > http://www.baselogic.com
> > > > http://www.blincmagazine.com
> > > > http://www.djmick.com
> > > > http://www.myspace.com/mickknutson
> > > > http://www.myspace.com/djmick_dot_com
> > > > http://www.myspace.com/sexybeotches
> > > > http://www.thumpradio.com
> > > > ---
> > > >
> > >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
>

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


Re: [m2] more than 1 artifact per pom.xml???

Posted by Thierry Lach <th...@gmail.com>.
I don't think that will work.  Maven tends to get confused when one pom is
used to do multiple things, and you'd be trying to make a pom do both an ear
and a module build.  It's tricky to get the correct plugin to work in the
different lifecycles, and even worse to get a plugin NOT to work in certain
lifecycles.

One possiblity that did occur to me would be to use the antrun plugin and
use ant commands to create your ear by binding antrun to the package phase.
You'd lose the deployment capability though, and IMO it would be much less
maintainable.

On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
>
> Can I do;
>
> ./pom.xml (EAR)
> ./war/pom.xml (WAR) (extends EAR pom)
>
>
> On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
> >
> > That's how I build my J2EE projects, too. I usually have a couple
> > /jarN and /ejb directories under there too.
> >
> > Wayne
> >
> > On 6/27/07, Thierry Lach <th...@gmail.com> wrote:
> > > I don't know if it would be a best practice, but I've been creating
> > projects
> > > that contains 3 poms...
> > >
> > > /pom.xml
> > > /war/pom.xml
> > > /ear/pom.xml
> > >
> > > First pom only references the other two poms as modules.
> > > The entire project can be built from the first pom.
> > >
> > >
> > > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > > >
> > > > I have dozens of web services that are being created as WAR's. For
> > > > consistency, each WAR that is deployed on seperate machines will be
> > > > packaged
> > > > as an EAR. Thus, each war also needed to be packaged into an EAR.
> > > >
> > > > Is there a better more "Best-Practices" way of doing this?
> > > >
> > > >
> > > >
> > > >
> > > > On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
> > > > >
> > > > > Why?? While you might be able to configure this with some complex
> > pom
> > > > > file, I don't see the point when it is far easier (and actually
> > > > > supported) to do this in 2 pom.xml files.
> > > > >
> > > > > Wayne
> > > > >
> > > > > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > > > > > I want to create a war and an ear in one module (pom.xml)
> > > > > >
> > > > > > --
> > > > > > ---
> > > > > > Thanks,
> > > > > > Mick Knutson
> > > > > >
> > > > > > http://www.baselogic.com
> > > > > > http://www.blincmagazine.com
> > > > > > http://www.djmick.com
> > > > > > http://www.myspace.com/mickknutson
> > > > > > http://www.myspace.com/djmick_dot_com
> > > > > > http://www.myspace.com/sexybeotches
> > > > > > http://www.thumpradio.com
> > > > > > ---
> > > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > ---
> > > > Thanks,
> > > > Mick Knutson
> > > >
> > > > http://www.baselogic.com
> > > > http://www.blincmagazine.com
> > > > http://www.djmick.com
> > > > http://www.myspace.com/mickknutson
> > > > http://www.myspace.com/djmick_dot_com
> > > > http://www.myspace.com/sexybeotches
> > > > http://www.thumpradio.com
> > > > ---
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
>

Re: [m2] more than 1 artifact per pom.xml???

Posted by Mick Knutson <mi...@gmail.com>.
Can I do;

./pom.xml (EAR)
./war/pom.xml (WAR) (extends EAR pom)


On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
>
> That's how I build my J2EE projects, too. I usually have a couple
> /jarN and /ejb directories under there too.
>
> Wayne
>
> On 6/27/07, Thierry Lach <th...@gmail.com> wrote:
> > I don't know if it would be a best practice, but I've been creating
> projects
> > that contains 3 poms...
> >
> > /pom.xml
> > /war/pom.xml
> > /ear/pom.xml
> >
> > First pom only references the other two poms as modules.
> > The entire project can be built from the first pom.
> >
> >
> > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > >
> > > I have dozens of web services that are being created as WAR's. For
> > > consistency, each WAR that is deployed on seperate machines will be
> > > packaged
> > > as an EAR. Thus, each war also needed to be packaged into an EAR.
> > >
> > > Is there a better more "Best-Practices" way of doing this?
> > >
> > >
> > >
> > >
> > > On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
> > > >
> > > > Why?? While you might be able to configure this with some complex
> pom
> > > > file, I don't see the point when it is far easier (and actually
> > > > supported) to do this in 2 pom.xml files.
> > > >
> > > > Wayne
> > > >
> > > > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > > > > I want to create a war and an ear in one module (pom.xml)
> > > > >
> > > > > --
> > > > > ---
> > > > > Thanks,
> > > > > Mick Knutson
> > > > >
> > > > > http://www.baselogic.com
> > > > > http://www.blincmagazine.com
> > > > > http://www.djmick.com
> > > > > http://www.myspace.com/mickknutson
> > > > > http://www.myspace.com/djmick_dot_com
> > > > > http://www.myspace.com/sexybeotches
> > > > > http://www.thumpradio.com
> > > > > ---
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > ---
> > > Thanks,
> > > Mick Knutson
> > >
> > > http://www.baselogic.com
> > > http://www.blincmagazine.com
> > > http://www.djmick.com
> > > http://www.myspace.com/mickknutson
> > > http://www.myspace.com/djmick_dot_com
> > > http://www.myspace.com/sexybeotches
> > > http://www.thumpradio.com
> > > ---
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] more than 1 artifact per pom.xml???

Posted by Wayne Fay <wa...@gmail.com>.
That's how I build my J2EE projects, too. I usually have a couple
/jarN and /ejb directories under there too.

Wayne

On 6/27/07, Thierry Lach <th...@gmail.com> wrote:
> I don't know if it would be a best practice, but I've been creating projects
> that contains 3 poms...
>
> /pom.xml
> /war/pom.xml
> /ear/pom.xml
>
> First pom only references the other two poms as modules.
> The entire project can be built from the first pom.
>
>
> On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> >
> > I have dozens of web services that are being created as WAR's. For
> > consistency, each WAR that is deployed on seperate machines will be
> > packaged
> > as an EAR. Thus, each war also needed to be packaged into an EAR.
> >
> > Is there a better more "Best-Practices" way of doing this?
> >
> >
> >
> >
> > On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > Why?? While you might be able to configure this with some complex pom
> > > file, I don't see the point when it is far easier (and actually
> > > supported) to do this in 2 pom.xml files.
> > >
> > > Wayne
> > >
> > > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > > > I want to create a war and an ear in one module (pom.xml)
> > > >
> > > > --
> > > > ---
> > > > Thanks,
> > > > Mick Knutson
> > > >
> > > > http://www.baselogic.com
> > > > http://www.blincmagazine.com
> > > > http://www.djmick.com
> > > > http://www.myspace.com/mickknutson
> > > > http://www.myspace.com/djmick_dot_com
> > > > http://www.myspace.com/sexybeotches
> > > > http://www.thumpradio.com
> > > > ---
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > ---
> > Thanks,
> > Mick Knutson
> >
> > http://www.baselogic.com
> > http://www.blincmagazine.com
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> > http://www.myspace.com/djmick_dot_com
> > http://www.myspace.com/sexybeotches
> > http://www.thumpradio.com
> > ---
> >
>

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


Re: [m2] more than 1 artifact per pom.xml???

Posted by Thierry Lach <th...@gmail.com>.
I don't know if it would be a best practice, but I've been creating projects
that contains 3 poms...

/pom.xml
/war/pom.xml
/ear/pom.xml

First pom only references the other two poms as modules.
The entire project can be built from the first pom.


On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
>
> I have dozens of web services that are being created as WAR's. For
> consistency, each WAR that is deployed on seperate machines will be
> packaged
> as an EAR. Thus, each war also needed to be packaged into an EAR.
>
> Is there a better more "Best-Practices" way of doing this?
>
>
>
>
> On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
> >
> > Why?? While you might be able to configure this with some complex pom
> > file, I don't see the point when it is far easier (and actually
> > supported) to do this in 2 pom.xml files.
> >
> > Wayne
> >
> > On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > > I want to create a war and an ear in one module (pom.xml)
> > >
> > > --
> > > ---
> > > Thanks,
> > > Mick Knutson
> > >
> > > http://www.baselogic.com
> > > http://www.blincmagazine.com
> > > http://www.djmick.com
> > > http://www.myspace.com/mickknutson
> > > http://www.myspace.com/djmick_dot_com
> > > http://www.myspace.com/sexybeotches
> > > http://www.thumpradio.com
> > > ---
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
>

Re: [m2] more than 1 artifact per pom.xml???

Posted by Mick Knutson <mi...@gmail.com>.
I have dozens of web services that are being created as WAR's. For
consistency, each WAR that is deployed on seperate machines will be packaged
as an EAR. Thus, each war also needed to be packaged into an EAR.

Is there a better more "Best-Practices" way of doing this?




On 6/27/07, Wayne Fay <wa...@gmail.com> wrote:
>
> Why?? While you might be able to configure this with some complex pom
> file, I don't see the point when it is far easier (and actually
> supported) to do this in 2 pom.xml files.
>
> Wayne
>
> On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> > I want to create a war and an ear in one module (pom.xml)
> >
> > --
> > ---
> > Thanks,
> > Mick Knutson
> >
> > http://www.baselogic.com
> > http://www.blincmagazine.com
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> > http://www.myspace.com/djmick_dot_com
> > http://www.myspace.com/sexybeotches
> > http://www.thumpradio.com
> > ---
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] more than 1 artifact per pom.xml???

Posted by Wayne Fay <wa...@gmail.com>.
Why?? While you might be able to configure this with some complex pom
file, I don't see the point when it is far easier (and actually
supported) to do this in 2 pom.xml files.

Wayne

On 6/27/07, Mick Knutson <mi...@gmail.com> wrote:
> I want to create a war and an ear in one module (pom.xml)
>
> --
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
>

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