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

Add a ProjectArtifactsCache similar to PluginArtifactsCache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.9
    • 3.5.2
    • Core
    • 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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: