Ah, I see your point.

Well, you can manually build the seperate peices using: mvn -f=jar_pom.xml.
There's no reason that the parent pom.xml file can't have as part of it's
build profile manual steps to execute the jar and war poms (perhaps through
an ant task bound to a phase?). This is not as nice as the modules setup,
however, may work.

Also, if your jars live in a source directory (such as, /src), then perhaps
the jar pom can be named simply pom.xml, and the war pom can also be named
pom in the base dir, with the parent pom being named parent_pom.xml.

I still beleive, however, that the best thing to do is to override the war
build plugin to spawn off seperate lifecycles, install the parts, then
continute assembling the whole war.

Thanks;
Eric

On 12/29/05, Frank Russo <[EMAIL PROTECTED]> wrote:
>
> I wasn't aware that you can create poms with different names. How does
> maven know to run with the secondary poms? I know you reference the main
> pom in the other two with a parent tag, but how does maven know to look
> for other two? Do I pass something in as an argument?
>
> Thanks...
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -----Original Message-----
> From: Eric Redmond [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 28, 2005 7:34 PM
> To: Maven Users List
> Subject: Re: Breaking up an existing webapp build
>
> What you could do is create a pom project in the base of the WAR, which
> then kicks off two modules... one as a JAR project which builds first,
> then the second one builds the WAR, with everything wrapped up inside
> it. This would require 3 POMs.
>
> For example, if your directory is set up as:
> BASE_WAR_DIR/java/source/files/
>
> You can create:
> BASE_WAR_DIR/pom.xml
> BASE_WAR_DIR/war_pom.xml
> BASE_WAR_DIR/jar_pom.xml
>
> Or better yet, you extend the WAR plugin and branch off another build
> cycle... the branched cycle would build the .class files into a jar,
> deploy, and then return to the main build cycle where it would use the
> jar (presumably with some derrivative name of the war).
>
>
> On 12/28/05, Frank Russo <[EMAIL PROTECTED]> wrote:
> >
> > I currently have a standard webapp project with a working m2 build
> > process. It builds a war with the typical web-inf structure as
> follows:
> >
> >         web-inf/classes/*        this is where the app's compiled
> > classes go.
> >         web-inf/lib/*.jar        this is where the dependency jars go.
> >
> > I want to alter my build so that instead of the app's class files in a
>
> > classes folder in the war, I'd prefer they first be built into a jar
> > file, placed in the local repository for other apps to use, and then
> > included as a dependcy in war's web-inf/lib folder.
> >
> > I know I need to set up two poms (maybe three), but I don't want to
> > break up the current package structure if possible, and I'd like this
> > to be done as one build.
> >
> > Can someone point me in the right direction?
> >
> > Thanks...
> >
> > Frank Russo
> > Senior Developer
> > FX Alliance, LLC
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to