maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wheeler <>
Subject Re: How Maven solves the problem of long builds on large projects?
Date Mon, 21 Dec 2015 14:07:29 GMT
- Break your project up into modules that build separately. If you have 
a well structured project that is loosely coupled, individual 
issues/bugs will only affect a few modules.
  We have a project with about 80 modules but never build them all at once.
- Build separately deployable modules so that you are building small 
jars and wars that can be individually replaced in your run-time or test 
- Build modules with 3rd party libraries so that you only have 1 copy of 
each library in your project rather than a copy in each module. The JVM 
can only use 1 copy of Apache commons-xxx; no point deploying 50 copies.
- Make sure that you have a repo "near" your workstation so that 
downloads of maven components and third party libraries are fast. We use 
the community version of Nexus.
- Use a RAMDrive to hold Maven and your compiler and your build 
temporary files. I have dedicated 2 Gb of RAM on my 6 Gb laptop. makes a 
big difference.
  I also have Eclipse/STS on that drive which makes a big difference in 
working with the IDE. If I had more memory,
  I would put my Maven cache in RAM but it currently has 14,799 files 
and takes 1.81GB. I probably should delete it and let Maven rebuild it 
to get rid of old crap(9 versions of junit).
- Use the latest Maven (including plug-ins) and Java.
- Only clean when you need to. Maven does a pretty good job of figuring 
out what needs to be re-compiled.

The first 3 ideas will give the biggest improvement.
If you have the RAM, the RAMDrive is easiest to do since it does not 
require much thinking.


On 21/12/2015 8:17 AM, Stephen Connolly wrote:
> I doubt it is the compilation that sucks up the time. Try running with test
> execution skipped to see the time difference, eg `mvn clean install` vs
> `mvn clean install -DskipTests`
> If you are using `install` then likely there is no need to rebuild
> everything each time and you can use the -pl -am and -and cli options to
> tune how much of the reactor to rebuild
> On Monday 21 December 2015, Sergey Saraev <> wrote:
>> Hello!
>> I am developing a project with 67 modules.
>> I use Apache Maven 3.0.4.
>> Reassembly of the project take 1 hour and 50 minutes although usually
>> commit change only one module.
>> The project is very large. It contains 5948 java classes (Basically, time
>> spent on their compilation.).
>> Build command: mvn clean install pmd:pmd checkstyle:checkstyle
>> cobertura:cobertura
>> Plugins versions:
>> maven-compiler-plugin:2.3.2
>> maven-antrun-plugin:1.6 (use wlappc task:
>> )
>> maven-surefire-plugin:2.10
>> maven-jar-plugin:2.3.2
>> maven-install-plugin:2.3.1
>> maven-pmd-plugin:2.7.1
>> maven-checkstyle-plugin:2.6
>> cobertura-maven-plugin:2.7
>> How to speed up the assembly?
>> (Maybe skip modules, which sources have not changed or something else)
>> Regards,
>> Sergey Saraev | Research & Development | Office: +7 (846) 270-7800 ext.
>> 2662 | Mobile: +7 (917) 813-5604 |
>> Proven Partner to Communications Service Providers
>> ________________________________
>> The information transmitted herein is intended only for the person or
>> entity to which it is addressed and may contain confidential, proprietary
>> and/or privileged material. Any review, retransmission, dissemination or
>> other use of, or taking of any action in reliance upon, this information by
>> persons or entities other than the intended recipient is prohibited. If you
>> received this in error, please contact the sender and delete the material
>> from any computer.

Ron Wheeler
Artifact Software Inc
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message