Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6025

Add a ProjectArtifactsCache similar to PluginArtifactsCache

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.9
    • Fix Version/s: 3.5.2
    • Component/s: core
    • Labels:
      None

      Description

      Every mojo execution, if it specifies dependency resolution other than 'none', will cause a resolution to be performed.
      There is a guard in MojoExecutor's DependencyContext which guards against performing this resolution multiple times by looking at the changes to dependencyArtifacts list.

      However, during a build in an incremental/interactive environment, like eclipse m2e or maven console, those mojos might be executed at an arbitrary time and will not benefit from that DependencyContext check.

      I propose having a ProjectArtifactsCache (very similar to PluginArtifactsCache) that will cache artifact set as returned by LifecycleDependencyResolver#getDependencies().

      While it does not improve cli builds, incremental/interactive builds will receive a huge performance boost between pom changes.
      I've been able to get build of a project with a lot of dependencies (jenkins plugin) and a number of (fully incremental) mojo executions from 7 seconds to around 1.5 on a single java file change in eclipse m2e after introducing this cache.

      I will provide a patch shortly.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user atanasenko opened a pull request:

          https://github.com/apache/maven/pull/82

          MNG-6025 Add a ProjectArtifactsCache similar to PluginArtifactsCache

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/atanasenko/maven mng6025

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/maven/pull/82.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #82


          commit 2d0ac1feec7dce0b5d278cfda0ae3df5110dde43
          Author: Anton Tanasenko <atg.sleepless@gmail.com>
          Date: 2016-05-18T15:40:28Z

          MNG-6025 Add a ProjectArtifactsCache similar to PluginArtifactsCache


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user atanasenko opened a pull request: https://github.com/apache/maven/pull/82 MNG-6025 Add a ProjectArtifactsCache similar to PluginArtifactsCache You can merge this pull request into a Git repository by running: $ git pull https://github.com/atanasenko/maven mng6025 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/maven/pull/82.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #82 commit 2d0ac1feec7dce0b5d278cfda0ae3df5110dde43 Author: Anton Tanasenko <atg.sleepless@gmail.com> Date: 2016-05-18T15:40:28Z MNG-6025 Add a ProjectArtifactsCache similar to PluginArtifactsCache
          Hide
          atanasenko Anton Tanasenko added a comment -

          I wasn't able to run ITs against latest master since those ITs appear to be in ruins, but I've run them with this patch applied to 3.3.9 and (after fixing a regression) all seems to be fine.

          I haven't yet thought of a proper place where this cache should be flushed (at the end of a single project build within a reactor maybe?).

          Show
          atanasenko Anton Tanasenko added a comment - I wasn't able to run ITs against latest master since those ITs appear to be in ruins, but I've run them with this patch applied to 3.3.9 and (after fixing a regression) all seems to be fine. I haven't yet thought of a proper place where this cache should be flushed (at the end of a single project build within a reactor maybe?).
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/maven/pull/82

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/maven/pull/82
          Hide
          michael-o Michael Osipov added a comment -
          Show
          michael-o Michael Osipov added a comment - Fixed with 7277a8464ba453aeacb82b22ffd966c9fb17c620 .
          Hide
          stephenc Stephen Connolly added a comment -

          Maven 3.4.0 has been dropped. See this thread for more details.

          This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.

          Show
          stephenc Stephen Connolly added a comment - Maven 3.4.0 has been dropped. See this thread for more details. This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.
          Show
          khmarbaise Karl Heinz Marbaise added a comment - Done with be223808939d75152d7157db33d45f230114555e

            People

            • Assignee:
              jvanzyl Jason van Zyl
              Reporter:
              atanasenko Anton Tanasenko
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development