[ 
https://issues.apache.org/jira/browse/MNG-6530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702814#comment-16702814
 ] 

Mickael Istria commented on MNG-6530:
-------------------------------------

{quote}for all others these changes are improvements{quote}
Search for "maven ProjectBuilder" on GitHub, you'll see many entries. This 
contains many plugins, all 3 main Java IDEs and a lot of other code that can 
very easily suffer from this bug. As the steps to reproduce are not trivial and 
it's in latest Maven, it can take some time before all those project 1. Adopt a 
version of Maven containing this bug and 2. notice the impact of the bug.

{quote}Why not do what Fred Bricon suggested in MNG-6311 and make the cache 
implementation injectable, then you could substitute a cache that evicts a POM 
file from the cache when the workspace knows it has been modified? {quote}
This wouldn't fix what's bug in ProjectBuilder IMO, and it would still require 
a big adoption effort for downstream components.
I'll let [~fbricon] comment more on that, but I think it would not fit m2e. The 
cache itself seems to cache objects (like DependencyManagement) which seem to 
have no link to the related pom file so there would be impossible for m2e to 
sort out what to invalidate and when (especially since m2e doesn't necessarily 
monitor the whole filesystem for changes in any pom file). The cache also comes 
with a cost in term of RAM; and in IDEs where users can import a project a 
delete it, it's totally possile that the cache contains thousands of elements 
(Apache Camel is ~800 modules for instance) and that we don't need them because 
related project are closed or removed from the IDE; so we can end up in 
consuming a lot of heap for data that's not interesting any more.
I think the system property or a simple setting to control that cache "scope" 
(is it a temporary cache for one invocation of ProjectBuilder.build(...) as it 
used to or is it a static cache for the lifecycle of the application as 
currently implemented?) is a better solution. At this point, the bug is so 
critical for m2e and family that we don't really care about the potential value 
of the new cache lifecycle in term of performance.

> Regression in ProjectBuilder when file change between invocations (introduced 
> by MNG-6311)
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-6530
>                 URL: https://issues.apache.org/jira/browse/MNG-6530
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.6.0
>            Reporter: Mickael Istria
>            Priority: Critical
>             Fix For: 3.6.1
>
>
> The patch for MNG-6311 introduces a regression in ProjectBuilder due to 
> missing cache invalidation when content change.
> It was identified as a potential issue by [~fbricon] on Oct 10, yet no 
> further investigation happened and Maven 3.6.0 was released with this 
> regression.
> This regression prevents Eclipse m2e (and probably most APIs using the 
> ProjectBuilder for a longer session which allows pom.xml files to be 
> modified) from adopting 3.6.0.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to