0

I have a multi module Maven project and I need help to optimize the time spent to build my Android module. When running the goals "clean install" or "verify" concluded that the Android project is consuming most of the time. The summary of time spent on builds is shown below:

[INFO] ------------------------------------------------------------------
[INFO] Building M-SPLearning Parent 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------
[INFO] ------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] M-SPLearning Entity ................... SUCCESS [1.710s]
[INFO] M-SPLearning Repository ............... SUCCESS [0.226s]
[INFO] M-SPLearning Service .................. SUCCESS [0.115s]
[INFO] M-SPLearning RESTful .................. SUCCESS [2.925s]
[INFO] M-SPLearning Android .................. SUCCESS [38.153s] << The Problem
[INFO] M-SPLearning Parent ................... SUCCESS [0.000s]
[INFO] ------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------
[INFO] Total time: 44.430s
[INFO] Finished at: Tue Jan 28 23:24:54 BRST 2014
[INFO] Final Memory: 24M/137M
[INFO] ------------------------------------------------------------------

The full output console can be accessed here.

Like to know if there are ways to improve the time spent in the build of the Android project, because I need run the build procedure (programmatically) in one of my RESTful services and 45~60 seconds is too long to wait the response.

The project source code is stored on GitHub.

Already, thanks!

falvojr
  • 3,060
  • 4
  • 31
  • 54
  • 1
    No solution here, just a couple of observations: First, you seem to have a dependency on Hibernate in your android app. That's probably making it much bigger than necessary, and slowing down the dex portion of the build. Second, 45 seconds really isn't that bad, but you could always throw hardware at it - use an SSD, for example, and make sure that you have plenty of ram, etc. – GreyBeardedGeek Jan 29 '14 at 02:49
  • Really the hardware is most responsible for the slowness in this case. Did some testing and just changing the hard drive of 5,600 to 7,200rpm I had a 50% improvement in time to build. Thanks @GreyBeardedGeek! – falvojr Apr 14 '14 at 02:25

1 Answers1

2

For starters I would upgrade to the Android Maven Plugin 3.8.1 (not 3.8.2 since that breaks apklib usage) and Maven 3.1.1 and then I would see what is actually slow. I have a feeling it is the dex run since you have a lot of dependencies. And if that is the case there is not much you can do.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
  • Hi @ManfredMoser, thanks for the answer! Could not update the Android Maven Plugin to version 3.8.1 because I need to maintain compatibility with version 3.0.4 of Maven, since this is the stable version available for Debian servers (see [Maven package](http://packages.qa.debian.org/m/maven.html)). In this context, I had a small improvement using version 3.7.0, the last without the need Maven 3.1.1+. But what really has optimized builds was the creation of independent profiles for Android and REST projects, see my parent [pom.xml](https://github.com/veniltonjr/msplearning/blob/master/pom.xml). – falvojr Apr 14 '14 at 00:39