Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-4885

Why incremental build is not supported natively by Maven?

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      I have a multi-module project with two sub-modules. I compile and package it without mistakes. The build is complete. Then I make a change in one .java file in one of them. And now I'm trying to package the whole project again. Maven re-runs tests in both two modules, static code analysis in both modules, etc.

      Why so? It's a very ineffective way of building, as far as I understand. Maybe maven can introduce a mechanism of "dependency discovery" between files. Like:

      foo.jar depends on:
        abc.java
        cde.java
      bar.jar depends on:
        xxx.java
      

      When there is a change in cde.java only - maven SHOULD NOT do anything with bar.jar. This is how Unix make utility is working... Thanks.

        Issue Links

          Activity

          Hide
          Wendy Smoak added a comment -

          You might want to re-post this on the mailing list (or search the archives – I think it's come up before).

          Show
          Wendy Smoak added a comment - You might want to re-post this on the mailing list (or search the archives – I think it's come up before).
          Hide
          Yegor Bugayenko added a comment -

          Actually the problem is related not only to multi-module projects. In general Maven doesn't use plugins incrementally, as I understand.

          Show
          Yegor Bugayenko added a comment - Actually the problem is related not only to multi-module projects. In general Maven doesn't use plugins incrementally, as I understand.
          Hide
          Jörg Schaible added a comment -

          It is more a problem of the plugins and the concept of plugins itself. The Maven core has no idea about the processed files and the actual result. Some plugins work implicitely incremental (compiler plugin using javac, because javac works this way), others are more ignorant (xmlbeans plugin generates the Java files always). So it seems better to create issues for the individual plugins to be more "intelligent" at detecting changes. E.g. the jar plugin does not have to run if the produced jar file is newer than anything that has to be collected. In case of the surefire plugin it is not so easy: It might omit the tests if all test reports are newer than anything in the classes or test-classdes folder, but it has also to check that no dependency has been updated ...

          Show
          Jörg Schaible added a comment - It is more a problem of the plugins and the concept of plugins itself. The Maven core has no idea about the processed files and the actual result. Some plugins work implicitely incremental (compiler plugin using javac, because javac works this way), others are more ignorant (xmlbeans plugin generates the Java files always ). So it seems better to create issues for the individual plugins to be more "intelligent" at detecting changes. E.g. the jar plugin does not have to run if the produced jar file is newer than anything that has to be collected. In case of the surefire plugin it is not so easy: It might omit the tests if all test reports are newer than anything in the classes or test-classdes folder, but it has also to check that no dependency has been updated ...
          Show
          Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014
          Hide
          Jason van Zyl added a comment -

          Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          Show
          Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

            People

            • Assignee:
              Unassigned
              Reporter:
              Yegor Bugayenko
            • Votes:
              7 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: