Creating multiple artifacts for a single project

2009-07-21 Thread Chetan Sarva
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

Re: Creating multiple artifacts for a single project

2009-07-21 Thread David Weintraub
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,

Re: Creating multiple artifacts for a single project

2009-07-21 Thread Chetan Sarva
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

Re: Creating multiple artifacts for a single project

2009-07-21 Thread David C. Hicks
Chetan Sarva wrote: While it feels like unnecessary overhead, having the second project makes things a bit more flexible in the end. You'll find that having your code split apart will also lead you down the path to better interfaces. So, that extra overhead will pay big dividends in the