You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mickael Istria (JIRA)" <ji...@apache.org> on 2018/11/28 15:58:00 UTC

[jira] [Commented] (MNG-6530) Regression in ProjectBuilder when file change between invocations (introduced by MNG-6311)

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

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

I had a look at how feasible it would be to make the cache understand when pom files change. It seems impossible to do it in the cache itself as the cache doesn't have any understanding of the object it caches and where they come from. So it seems to only be achievable in DefaultModelBuilder that should ignore artifacts from the cache if they are outdated.
The places that need to have a change are basically all consumers of DefaultModelBuilder.getCache().

For the readParent part, it seems achievable although not trivial: we'd need a way to have the ModelData store a creationTimestamp when created and to propagate it to clones. With this creationTimestamp, we can compare it to the lastModificationTimestamp of the underlying pom file and decide to ignore cache when lastModificationTimestamp > ModelData.creationTimestamp.
For the dependency part, it's much harder since the DependencyManagement item that's stored in the cache doesn't contain any information regarding the actual pom.xml that generated it, so we cannot deduce a creationTimestamp nor the last modificationTimestamp of the supporting file.

Note that the test I contributed only covers the parent part, not the depedency one. A test for dependencies should be added to ensure a fix is valid.

At the moment, there is still no clear solution, and I think it'd still be best to consider reverting the changes from MNG-6311.

> 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, 3.6.1
>            Reporter: Mickael Istria
>            Priority: Critical
>
> 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)