You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Igor Fedorenko (JIRA)" <ji...@codehaus.org> on 2009/02/18 04:35:19 UTC

[jira] Created: (MNG-4041) embedder returns stale maven project state

embedder returns stale maven project state
------------------------------------------

                 Key: MNG-4041
                 URL: http://jira.codehaus.org/browse/MNG-4041
             Project: Maven 2
          Issue Type: Bug
          Components: Embedding
    Affects Versions: 3.0-alpha-3
            Reporter: Igor Fedorenko
         Attachments: staleproject.zip

Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.

The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.

Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes

* project artifact id
* values of all properties
* all active profiles
* content of all pom.xml files directly and indirectly involved in construction of maven project instance
* IDE specific state, like m2e "enable workspace dependency resolution"
* likely more...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4041) embedder returns stale maven project state

Posted by "Milos Kleint (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=179385#action_179385 ] 

Milos Kleint commented on MNG-4041:
-----------------------------------

it would be nice to have an option to put a custom caching strategy in place. With the old 2.1 snapshots, there was a Workspace*someting* component. it was purged after each call to project resolution. Changing it to timed weak references I was able to speed up the loading of multiple projects significantly, while cleaning up in the long run..


> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNG-4041) embedder returns stale maven project state

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl closed MNG-4041.
------------------------------

    Resolution: Fixed

Patch applied and m2eclipse is working well with this in place.

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4041) embedder returns stale maven project state

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=179707#action_179707 ] 

Benjamin Bentmann commented on MNG-4041:
----------------------------------------

Applied additional patch in [r782776|http://svn.apache.org/viewvc?view=rev&revision=782776], thanks Igor!

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041-c.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4041) embedder returns stale maven project state

Posted by "Igor Fedorenko (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Fedorenko updated MNG-4041:
--------------------------------

    Attachment: MNG-4041-d.diff

Attached MNG-4041-d.diff corrects a bug in plugin dependencies comparison, which could result in caching of duplicate realms and/or wrong cache hits.


> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041-c.diff, MNG-4041-d.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4041) embedder returns stale maven project state

Posted by "Igor Fedorenko (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Fedorenko updated MNG-4041:
--------------------------------

    Attachment: MNG-4041-c.diff

Revised version of the second patch. After some further discussions we came to the conclusion that plugin/executions should not be considered when caching neither plugin realms nor plugin descriptors.

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041-c.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4041) embedder returns stale maven project state

Posted by "Igor Fedorenko (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Fedorenko updated MNG-4041:
--------------------------------

    Attachment: MNG-4041-c.diff

Attached MNG-4041-c.diff patch fixes couple of problems in the original implementation

* Plugin CacheKey equals method considers repositories now (thank you for spotting this, Benjamin).
* Plugins that differ only in <executions/> use the same plugin realm.

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4041) embedder returns stale maven project state

Posted by "Igor Fedorenko (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Fedorenko updated MNG-4041:
--------------------------------

    Attachment: MNG-4041.diff

Attached replaces MavenProject cache with two simpler (relatively speaking) caches -- maven metadata source and pluginDescriptor/pluginRealm. It also defers plugin dependency resolution, plugin realm construction and component discovery until mojo execution. This eliminates unnecessary artifact resolution and classloading overhead for plugins that are never used (site plugin during clean/install build, for example). The patch is against maven trunk.

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4041) embedder returns stale maven project state

Posted by "Igor Fedorenko (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Fedorenko updated MNG-4041:
--------------------------------

    Attachment: MNG-4041-e.diff

Attached MNG-4041-e.diff implements missing hashCode/equals methods in ArtifactFilter classes. ArtifactFilters are used in hash maps by DefaultMavenMetadataCache and missing hashCode/equals was causing duplicate cache entries.

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041-c.diff, MNG-4041-d.diff, MNG-4041-e.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4041) embedder returns stale maven project state

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=180999#action_180999 ] 

Benjamin Bentmann commented on MNG-4041:
----------------------------------------

Commited in [r786882|http://svn.apache.org/viewvc?view=rev&revision=786882]. Thanks but in the future please try to remember to add the Apache license header to new files.

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041-c.diff, MNG-4041-d.diff, MNG-4041-e.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4041) embedder returns stale maven project state

Posted by "Milos Kleint (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=179738#action_179738 ] 

Milos Kleint commented on MNG-4041:
-----------------------------------

Igor: allowing custom cache implementations in the container is more than enough, I never meant to suggest tat weak references shall be used by default..

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041-c.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4041) embedder returns stale maven project state

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=180991#action_180991 ] 

Benjamin Bentmann commented on MNG-4041:
----------------------------------------

Commited in [r786811|http://svn.apache.org/viewvc?view=rev&revision=786811], good catch!

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041-c.diff, MNG-4041-c.diff, MNG-4041-d.diff, MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-4041) embedder returns stale maven project state

Posted by "Igor Fedorenko (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=179442#action_179442 ] 

Igor Fedorenko commented on MNG-4041:
-------------------------------------

Milos, both caches have flush() method, so it is possible to purge them when needed. It is also possible to provide custom cache implementations using container customization hooks (this is what I plan to do in m2e). I am not sure if it makes sense to change default implementation to use weak references.

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: MNG-4041.diff, staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-4041) embedder returns stale maven project state

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl updated MNG-4041:
-------------------------------

    Affects Version/s:     (was: 3.0-alpha-3)
                       3.0-alpha-2
        Fix Version/s: 3.0-alpha-3

> embedder returns stale maven project state
> ------------------------------------------
>
>                 Key: MNG-4041
>                 URL: http://jira.codehaus.org/browse/MNG-4041
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0-alpha-2
>            Reporter: Igor Fedorenko
>             Fix For: 3.0-alpha-3
>
>         Attachments: staleproject.zip
>
>
> Embedder returns stale maven project state after project's pom.xml changed and re-read. This is extremely common scenario when using embedder in IDE like m2e. See attached sample project that demonstrates one of many possible ways to trigger this problem.
> The problem appears to be related to static (!) MavenProject cache in DefaultMavenProjectBuilder, which means that even recreating embedder instance is not going to purge state cache entries.
> Also note that using artifact#getId does not provide enough context to uniquely identify cached MavenProject instances. This is particularly true for IDEs where the same embedder instance is likely to be used to process unrelated projects. Cached MavenProject instances should be identified at least by the following attributes
> * project artifact id
> * values of all properties
> * all active profiles
> * content of all pom.xml files directly and indirectly involved in construction of maven project instance
> * IDE specific state, like m2e "enable workspace dependency resolution"
> * likely more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira