I looked at assemblies as an option and while I think that may be possible I
decided to go with a 1:1 pom->artifact ratio. I split my WAR artifact into a
separate project/module which depends on the JAR created by the main module.

While it feels like unnecessary overhead, having the second project makes
things a bit more flexible in the end.

On Tue, Jul 21, 2009 at 1:15 PM, David Weintraub <[email protected]> wrote:

> Take a look at assemblies. That will allow you to package your source
> in a jar or tarball.
>
> To create an assembly, you need the assembly plugin in your pom.xml,
> and you need to define an assembly file which describes what will be
> in your assembly (usually stored in /src/main/assembly. Optionally,
> you can redefine the package lifecycle to build the assembly for you.
> Otherwise, it will only build if you do "mvn assembly:assembly".
>
> See <http://maven.apache.org/plugins/maven-assembly-plugin/>
>
> On Tue, Jul 21, 2009 at 1:09 PM, Chetan Sarva<[email protected]> wrote:
> > Hi,
> >
> > I've got a single pom.xml from which I want to create multiple artifacts.
> I
> > want to package the source as a JAR (so other projects can mark it is as
> a
> > dependency) as well as a WAR for deploying directly.
> >
> > I'm able to create 2 packages currently, but when I try to include the
> JAR
> > into another project, it seems to grab the WAR file instead. How can I
> set
> > different artifact id's for each artifact so that I can select the
> correct
> > one?
> >
> > chetan
> >
>
>
>
> --
> David Weintraub
> [email protected]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to