Skip to content

Commit fcf7337

Browse files
committed
Fix
1 parent d85f59f commit fcf7337

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,9 @@ Model doReadFileModel() throws ModelBuilderException {
11851185
rootDirectory = request.getSession().getRootDirectory();
11861186
} catch (IllegalStateException ignore) {
11871187
rootDirectory = modelSource.getPath();
1188+
while (rootDirectory != null && !Files.isDirectory(rootDirectory)) {
1189+
rootDirectory = rootDirectory.getParent();
1190+
}
11881191
}
11891192
try (InputStream is = modelSource.openStream()) {
11901193
model = modelProcessor.read(XmlReaderRequest.builder()

0 commit comments

Comments
 (0)