maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Fedorenko (JIRA)" <>
Subject [jira] (MNG-5669) same pom.xml is read multiple times
Date Mon, 28 Jul 2014 16:16:10 GMT
Igor Fedorenko created MNG-5669:

             Summary: same pom.xml is read multiple times
                 Key: MNG-5669
             Project: Maven
          Issue Type: Bug
    Affects Versions: 3.2.3
            Reporter: Igor Fedorenko

The same parent pom.xml is read multiple times during single ProjectBuilder#build invocation.
This is a performance regression introduced in 3.2.3-SNAPSHOT. I do not know how much this
affects real-world build performance.


ProjectBuilder#build(File,ModelSource,...) first constructs project model then
initializes MavenProject instance.

When project model is constructed, all local and remote parent pom.xml files
are read and stored in model cache during ModelBuilder#readParent. The cache  uses GAV keys.
Only parent models are stored in the cache. The model of the project being being is not cached.

When MavenProject instance is initialized, ProjectBuilder#build is called recursively to create
parent MavenProject instances.

There are appears to be two problems

* ModelCache used to create original project Model is not passed to the 
  recursive ProjectBuilder#build invocation.
* ProjectBuilder#build does not use ModelCache for the project being built.
  During recursive invocation, this means the cache is never used to load
  parent pom.xml models cached during outer ProjectBuilder#build invocation.

The solution is to introduce additional short-lived model cached keyed by 
pom.xml file location (project GAV is not known when ProjectBuilder#build is
called). Alternatively, introduce ProjectBuilder#buildParent that will use
the model cache.

This message was sent by Atlassian JIRA

View raw message