mirror of https://github.com/apache/maven.git
[MNG-8288] "path cannot be null" (#1782)
It seems Maven is eager to get POM from rootDirectory to support CI Friendly versions. This change makes it "best effort", as in if there is no POM, just walk away. --- https://issues.apache.org/jira/browse/MNG-8288
This commit is contained in:
parent
165588cbda
commit
b2b868f864
|
@ -1328,9 +1328,12 @@ public class DefaultModelBuilder implements ModelBuilder {
|
||||||
// defined on the root project.
|
// defined on the root project.
|
||||||
Map<String, String> properties = new HashMap<>();
|
Map<String, String> properties = new HashMap<>();
|
||||||
if (!Objects.equals(rootDirectory, model.getProjectDirectory())) {
|
if (!Objects.equals(rootDirectory, model.getProjectDirectory())) {
|
||||||
Model rootModel = derive(ModelSource.fromPath(modelProcessor.locateExistingPom(rootDirectory)))
|
Path rootModelPath = modelProcessor.locateExistingPom(rootDirectory);
|
||||||
.readFileModel();
|
if (rootModelPath != null) {
|
||||||
properties.putAll(rootModel.getProperties());
|
Model rootModel =
|
||||||
|
derive(ModelSource.fromPath(rootModelPath)).readFileModel();
|
||||||
|
properties.putAll(rootModel.getProperties());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
properties.putAll(model.getProperties());
|
properties.putAll(model.getProperties());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue