Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid wasting time during compilation during development?

I'm working with a small team of developers. My job is to convert a Make project (with Intellij Idea 9.0) into a Maven 2 project.

The problem is : we spend a lot of time during the development. With Make, only one complete build was required and then any change did not consume a lot of time (almost instantaneously). On the other hand, with Maven 2, a little change takes a lot of time to run.

Any solution ? Thanks.

like image 512
Sandro Munda Avatar asked Apr 20 '10 19:04

Sandro Munda


3 Answers

The problem you're facing and its description are not clear (what is your project structure, how you build it, how much time does it take to compile one change, etc) but here are some practices that could help:

  • Use incremental builds (i.e. don't use clean at each build).
  • Use binary dependencies (i.e. multiple modules with dependencies vs of a huge monolithic module).
  • Use advanced reactor options for smart reactor build (to build only the required subset of modules).
  • Use Maven Shell (if you're not aware of this project, CHECK IT OUT).

Personally, I'm not experiencing "lot of time to run" problems with my projects.

like image 110
Pascal Thivent Avatar answered Nov 02 '22 08:11

Pascal Thivent


On the other hand, with Maven 2, a little change takes a lot of time to run.

I'm not really sure that this has to be true. For a single Maven project, the compile phase doesn't need to recompile all source from scratch, just what has been updated since the last run (assuming you haven't done a clean, etc.).

Without further details though it's hard to offer any advice. Have you converted to Maven and are finding that it seems to be excessively re-building many parts of your projects? If so, please provide more details as Pascal mentions aboves. Or is this just a question driven by fear?

like image 36
matt b Avatar answered Nov 02 '22 08:11

matt b


IntelliJ can load the module/project configuration from the pom files. This means that during development, use IntelliJ's build based of the pom files (which is incremental and quick) and only use maven stand alone for continous integration and releases.

like image 1
Peter Lawrey Avatar answered Nov 02 '22 06:11

Peter Lawrey