Skip to content

Commit

Permalink
[MNG-7759] Maven2 plugins will not have even session setter (#1084)
Browse files Browse the repository at this point in the history
As setter was added in Maven3. Still, this causes unexpected NPE
during plugin execution, while Maven3 should support Maven2
plugins.

---

https://issues.apache.org/jira/browse/MNG-7759
  • Loading branch information
cstamas authored Apr 13, 2023
1 parent bc138dc commit eb7cdef
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,10 @@ class InternalConfig {
}

private ModelCache createModelCache(RepositorySystemSession session) {
// MNG-7759: very old clients (Maven2 plugins) will not even have session, as setter was added in Maven 3
if (session == null) {
return null;
}
// MNG-7693: for older clients (not injecting ModelCacheFactory), make this work OOTB w/ defaults
return modelCacheFactory != null
? modelCacheFactory.createCache(session)
Expand Down

0 comments on commit eb7cdef

Please sign in to comment.