8000 [MNG-7759] Maven2 plugins will not have even session setter (#1084) · apache/maven@eb7cdef · GitHub
[go: up one dir, main page]

Skip to content

Commit eb7cdef

Browse files
authored
[MNG-7759] Maven2 plugins will not have even session setter (#1084)
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
1 parent bc138dc commit eb7cdef

File tree

1 file changed

+4
-0
lines changed

maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,10 @@ class InternalConfig {
10001000
}
10011001

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

0 commit comments

Comments
 (0)
0