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: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org