You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by sivarenati <si...@gmail.com> on 2012/07/06 13:27:00 UTC

is it possible to creating war and jar files with single POM.xml file?

hi frnds, 

Is it possible to create war and jar files with single pom.xml file. 

i have to create jar file for my project along with war.

please help me on this if know how to do it.





Regrds.
Siva 



--
View this message in context: http://maven.40175.n5.nabble.com/is-it-possible-to-creating-war-and-jar-files-with-single-POM-xml-file-tp5713154.html
Sent from the Maven Developers mailing list archive at Nabble.com.

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


Re: is it possible to creating war and jar files with single POM.xml file?

Posted by Anders Hammar <an...@hammar.net>.
Yes, that's what I meant. It is much better to have two modules - one
jar project and one war project (with a dependency to the jar
artifact).

/Anders

On Fri, Jul 6, 2012 at 9:59 PM, Manfred Moser <ma...@mosabuam.com> wrote:
> While it might be possible it is a bad idea that will cause your problems
> most likely... why do you want to do that?
>
> manfred
>
> On Fri, July 6, 2012 12:18 pm, Anders Hammar wrote:
>> Yes, although it's not good practice. One project should only produce
>> one main artifact.
>>
>> To have the maven-war-plugin create an additional jar artifact with
>> the java classes, have a look at this config parameter:
>> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses
>>
>> /Anders
>>
>> On Fri, Jul 6, 2012 at 1:27 PM, sivarenati <si...@gmail.com> wrote:
>>> hi frnds,
>>>
>>> Is it possible to create war and jar files with single pom.xml file.
>>>
>>> i have to create jar file for my project along with war.
>>>
>>> please help me on this if know how to do it.
>>>
>>>
>>>
>>>
>>>
>>> Regrds.
>>> Siva
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://maven.40175.n5.nabble.com/is-it-possible-to-creating-war-and-jar-files-with-single-POM-xml-file-tp5713154.html
>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

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


Re: is it possible to creating war and jar files with single POM.xml file?

Posted by Manfred Moser <ma...@mosabuam.com>.
While it might be possible it is a bad idea that will cause your problems
most likely... why do you want to do that?

manfred

On Fri, July 6, 2012 12:18 pm, Anders Hammar wrote:
> Yes, although it's not good practice. One project should only produce
> one main artifact.
>
> To have the maven-war-plugin create an additional jar artifact with
> the java classes, have a look at this config parameter:
> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses
>
> /Anders
>
> On Fri, Jul 6, 2012 at 1:27 PM, sivarenati <si...@gmail.com> wrote:
>> hi frnds,
>>
>> Is it possible to create war and jar files with single pom.xml file.
>>
>> i have to create jar file for my project along with war.
>>
>> please help me on this if know how to do it.
>>
>>
>>
>>
>>
>> Regrds.
>> Siva
>>
>>
>>
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/is-it-possible-to-creating-war-and-jar-files-with-single-POM-xml-file-tp5713154.html
>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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


Re: is it possible to creating war and jar files with single POM.xml file?

Posted by Anders Hammar <an...@hammar.net>.
Yes, although it's not good practice. One project should only produce
one main artifact.

To have the maven-war-plugin create an additional jar artifact with
the java classes, have a look at this config parameter:
http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses

/Anders

On Fri, Jul 6, 2012 at 1:27 PM, sivarenati <si...@gmail.com> wrote:
> hi frnds,
>
> Is it possible to create war and jar files with single pom.xml file.
>
> i have to create jar file for my project along with war.
>
> please help me on this if know how to do it.
>
>
>
>
>
> Regrds.
> Siva
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/is-it-possible-to-creating-war-and-jar-files-with-single-POM-xml-file-tp5713154.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

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


Re: is it possible to creating war and jar files with single POM.xml file?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hi,

you can use maven assembly plugin to create the war for instance and let
maven jar plugin create the jar. Another way is to define maven war plugin
and maven jar plugin then use maven build helper plugin to attach both
artifacts

so yes that's possible

- Romain


2012/7/6 sivarenati <si...@gmail.com>

> hi frnds,
>
> Is it possible to create war and jar files with single pom.xml file.
>
> i have to create jar file for my project along with war.
>
> please help me on this if know how to do it.
>
>
>
>
>
> Regrds.
> Siva
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/is-it-possible-to-creating-war-and-jar-files-with-single-POM-xml-file-tp5713154.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>