apache / apache/maven

[MNG-6911] Allow the Maven model cache to recache a maven model on request

Open
#8,615 6 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Andrew Obuchowicz](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=aobuchow)** opened **[MNG-6911](https://issues.apache.org/jira/browse/MNG-6911?redirect=false)** and commented

Hi, I'm one of the developers of [LemMinX-Maven|https://github.com/eclipse/lemminx-maven] which is a project that implements the Language Server Protocol for editing Maven pom.xml files (any LSP client editor can easily gain pom.xml editing features with this project).

 

We've encountered an [issue|https://github.com/eclipse/lemminx-maven/pull/67] where modifications to a parent pom (such as adding a new property) are not reflected in the child pom, as the global model cache has an outdated version of the parent pom (before the modification was made).

 

Disabling the global model cache works as a temporary workaround, eg.

 

```java
System.setProperty(DefaultProjectBuilder.DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY, Boolean.toString(true));
```

 

However, we'd still like to use the model cache and not have to disable it entirely.

 

Thus, it would be beneficial if the model cache could "uncache" (or refresh) a pom that has been modified. From our project, we can easily detect when a pom.xml has been modified, thus tracking pom modifications does not need to be implemented. **What is required on the Maven API side** is to be able to signal that a pom.xml has been modified, and should be recached with the new modifications.

 

Also, I apologize in advance if this was reported under the wrong project or component. Feel free to place it where it should be.

 

---

**Affects:** 3.6.3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.