maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maczka Michal <>
Subject RE: Problem with phase lifecycle
Date Thu, 03 Mar 2005 09:02:48 GMT

> -----Original Message-----
> From: Brett Porter []
> Sent: Wednesday, March 02, 2005 11:01 PM
> To: Maven 2 Developers List
> Subject: Re: Problem with phase lifecycle

> >Not really, war:webapp and war:war are 2 very different tasks.
> >  
> >
> I don't agree - war:war is war:webapp + jar:jar, making them quite
> similar :)
> A couple of thoughts...
> Is war:war pulling in its sources as is (ie jarring from 
> target/classes,
> src/main/webapp, etc), or is it building up the exploded war:webapp in
> target, then jarring that like m1? 

Neither of them.

war:webapp is assembling exploded web applictaion
in the folder defined by: "maven.war.webapp.dir" property.
As far as I know many people who use that goal often choose something like
${SERVLET_CONTAINER_ROOT}/webapps/myapp as "maven.war.webapp.dir".

The whole idea of my implementation of war plugin in m1 was to divide the
processing into well defined
phases: assembling (war:webapp) and packaging (war:war).
I am myslef using war:webapp phase (with help of preGoals) for example for
adding to wars different resources (e.g. css & js files)
which are packaged in zip artifacts. In some other cases I am using this
phase to "customize" existing war artifacts.
By that I mean: I pull existing war(s) from the repository (dependencies on
wars are defined in poms), unpack it, and them either 
I overrwirite files which exist in that orginal war (e.g. web.xml file) or
sometimes I use resource filtering for replacing
some variables in the configuration files.

>I believe it can be more 
> effecient by
> pulling them all in, if possible. 

Sure it can be much more efficient. But this will remove certain
I would rather preserve that flexibility then make it bit faster (various
optmisiation can be implemented later on).

Note that many people is really annoyed (including me) by the fact that
war:webapp goal is executing unit tests.
If you changed a single js/css file in your web application this is really
an overkill.

So I can suggest that one more phase is needed after compile phase
(something like "assmble").
The execution of that phase will produce "exploded artifacts" and no unit
test should be  executed for that.

So there will be subtle difference between

m2 assemble


m2 test 

as test phase is executed after "assemble" so users will be still free to
choose if they want to perform tests or not.

>If it is not posssible - is it
> necessary to distinguish? 

imo yes. see my examples above.

>war:war will build the webapp 
> anyway, so there
> really is no need for just war:webapp. The JAR step is quite small and
> quick.

I am using war:webapp all the time in m1 and very rarly I execute goals like
In case of the big web applications (say 20 MB+) "jar step" is not as fast
as you think. It can easly take a dozen of seconds.

> Cheers,
> Brett

my 2 cents


View raw message