You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Attila Mezei-Horvati <at...@yahoo.com> on 2006/08/21 22:30:00 UTC

mvn 2: create jar in war

How can I create a jar from the classes compiled into
the war? (for tomcat)

Currently if I run the war package it leaves my
sources in the web-inf/classes dir as compiled
classes. I would like to put them in a jar and have it
included in the web-inf/lib dir. Is that possible?

thanks,
Attila

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: mvn 2: create jar in war

Posted by Tomasz Pik <to...@gmail.com>.
On 8/21/06, Attila Mezei-Horvati <at...@yahoo.com> wrote:
> How can I create a jar from the classes compiled into
> the war? (for tomcat)
>
> Currently if I run the war package it leaves my
> sources in the web-inf/classes dir as compiled
> classes. I would like to put them in a jar and have it
> included in the web-inf/lib dir. Is that possible?

I think you should try 'archiveClasses' config element in <configuration>
element for maven-war-plugin but Ive never used it myself...
More here: http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#archiveClasses

HTH,
Tomek

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


Re: mvn 2: create jar in war

Posted by David Smiley <DS...@mitre.org>.
I've done this off and on simply by doing "mvn jar:jar".  It'll create the
jar in the target directory.  I haven't integrated this into an automated
build... I only have a need for this once in a rare while.
~ David Smiley


Attila Mezei-Horvati wrote:
> 
> How can I create a jar from the classes compiled into
> the war? (for tomcat)
> 
> Currently if I run the war package it leaves my
> sources in the web-inf/classes dir as compiled
> classes. I would like to put them in a jar and have it
> included in the web-inf/lib dir. Is that possible?
> 
> thanks,
> Attila
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Investigating-a-checksum-failure-tf2142454.html#a5925012
Sent from the Maven - Users forum at Nabble.com.


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


Re: mvn 2: create jar in war

Posted by Wendy Smoak <ws...@gmail.com>.
On 8/21/06, Attila Mezei-Horvati <at...@yahoo.com> wrote:

> How can I create a jar from the classes compiled into
> the war? (for tomcat)
>
> Currently if I run the war package it leaves my
> sources in the web-inf/classes dir as compiled
> classes. I would like to put them in a jar and have it
> included in the web-inf/lib dir. Is that possible?

I would put those classes in a separate module that builds a jar, and
have the webapp depend on that jar.

This also frees up the src/test/ directory hierarchy for tests that
exercise the webapp itself, such as HttpUnit or HtmlUnit-based tests.
Maven isn't currently very easy to configure for both unit and
integration/functional tests in the same module.

-- 
Wendy

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


Re: mvn 2: create jar in war

Posted by Tamás Cservenák <t....@gmail.com>.
Hi,

(Maven2)
if you need the WAR classes in JAR coz you want it to include in a WAR/lib,
the logical path would be to separate your WAR into two Maven modules:

one for Java sources only, which is packaging JAR
and for WAR with packaging war for resources, jsps, etc which reference the
previous as dependency.

Remember: do not try to create two artifacts from one POM, it is possible
but not in M2 spirit.

~t~

On 8/21/06, Attila Mezei-Horvati <at...@yahoo.com> wrote:
>
> How can I create a jar from the classes compiled into
> the war? (for tomcat)
>
> Currently if I run the war package it leaves my
> sources in the web-inf/classes dir as compiled
> classes. I would like to put them in a jar and have it
> included in the web-inf/lib dir. Is that possible?
>
> thanks,
> Attila
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>