You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Williams <dn...@gmail.com> on 2007/08/16 16:09:53 UTC
Can you have Maven create a jar and a war for an artifact
Hi Eveyone,
We currently create a war file for a certain artifact. Now another group
has created an application that requires the first artifact to be a jar not
a war. Is there any way to have maven create both a jar and a war for a
single artifact?
Thanks,
David
Re: Can you have Maven create a jar and a war for an artifact
Posted by John Casey <jd...@commonjava.org>.
Typically, we recommend you split out the webapp-specific files into
another project that depends on the first. Then, you can set the
packaging of the first project to 'jar' and to 'war' for the second.
Now, your other group can simply depend on the jar artifact.
-john
On Aug 16, 2007, at 10:09 AM, David Williams wrote:
> Hi Eveyone,
>
> We currently create a war file for a certain artifact. Now another
> group
> has created an application that requires the first artifact to be a
> jar not
> a war. Is there any way to have maven create both a jar and a war
> for a
> single artifact?
>
> Thanks,
>
> David
---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john
Re: Can you have Maven create a jar and a war for an artifact
Posted by John Casey <jd...@commonjava.org>.
Sure. The problem you're going to have with this is, both jar:jar and
war:war (if that's the right mojo name) will set the main project
artifact to their respective output...leaving you with the question
"Which one will be installed in the local repository" and the more
important question "Which one will get RELEASED?"
To me, this is a question of decomposition. You have common code used
by two projects, so factor it out into a separate project. The fact
that one of the projects only decorates this common code with as-yet-
uncompiled JSP or similar doesn't change that fact.
Just my $0.02.
-john
On Aug 16, 2007, at 10:27 AM, Mel Riffe wrote:
> Hi David,
>
> I think the "Maven Way" suggests you have a project for the Jar and a
> project for the War.
>
> However, executing 'jar:jar' within the project should produce the
> desired
> results.
>
> HTH
> Mel
>
> On 8/16/07, David Williams <dn...@gmail.com> wrote:
>>
>> Hi Eveyone,
>>
>> We currently create a war file for a certain artifact. Now
>> another group
>> has created an application that requires the first artifact to be
>> a jar
>> not
>> a war. Is there any way to have maven create both a jar and a war
>> for a
>> single artifact?
>>
>> Thanks,
>>
>> David
>>
---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john
Re: Can you have Maven create a jar and a war for an artifact
Posted by Mel Riffe <sh...@gmail.com>.
Hi David,
I think the "Maven Way" suggests you have a project for the Jar and a
project for the War.
However, executing 'jar:jar' within the project should produce the desired
results.
HTH
Mel
On 8/16/07, David Williams <dn...@gmail.com> wrote:
>
> Hi Eveyone,
>
> We currently create a war file for a certain artifact. Now another group
> has created an application that requires the first artifact to be a jar
> not
> a war. Is there any way to have maven create both a jar and a war for a
> single artifact?
>
> Thanks,
>
> David
>