You could deploy in place or unpacked or something similar, there is more than one way to deploy or test your webapp without it having to be packed into the WAR, which is what takes most of the build time for us too.

Em 13-05-2011 01:42, Ron Wheeler escreveu:
On 12/05/2011 12:53 PM, javadaisy wrote:
Hi,

I am using maven 2.2.1 with cargo plugin to deploy into the local and
remote
host. It takes around 7 to 8 minutes to build and deploy the war. I would
like to reduce the time to 3 minutes or less than 3 minutes. can anybody
please tell me how to do that?.

I tried adding set MAVEN_OPTS=-DXms_1024M -DXmx=1024M in mvn.bat. It
didn't
work

How big is the WAR file?
There are physical limits to the speed at which disk drives work.

How long does it take on other machines? Is it only slow on some
workstations?

One of the most effective tricks is to segregate third party libraries
into sharable JARs that you only build once and deploy to the servlet
engine (Tomcat) once.
You set these as "provided" in the WAR file's POM and suddenly the build
creates a WAR that is 20 Mb smaller and builds 10 times faster.
Things like CXF (Web Services) add 20Mb to each WAR. If you make it
shareable and scope it as "provided" in the POM, the WAR drops to a few
tens of kilobytes that builds PDQ.

We have done this is 10+ cases to get common third-party and our own
utilities out of our 60+ WAR files that implement services and servlets.
- Spring, Hibernate, MySQL in one shared jar
- CXF
- JasperReports
- Apache Commons - lots of modules that everyone uses.
- our messaging/e-mail utility
- our facades that simplify our internal connections
- API and core functions that define the ORM and business processes

The WARs now contain only the code and resources that uniquely exist to
support the WAR's functionality.

It also eliminates the "jar hell" of conflicting versions of common
dependencies. Once you decide which version of commons-logging you want
to use, everyone gets it.

POM files get really small since they only refer to 10 dependencies or
less (typically 5 dependencies) to get all of the 90+ officially
sanctioned libraries.

Big help at run-time as well.

Ron

Thanks in advance.

--
View this message in context:
http://maven.40175.n5.nabble.com/help-how-to-reduce-the-build-time-using-mvn-and-cargo-tp4390836p4390836.html

Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to