Skip to content

Commit 4edba6d

Browse files
authored
Fallback to settings.xml for MavenExecutionContextView.getLocalRepository (#4484)
1 parent 7f14d4a commit 4edba6d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,15 @@ public MavenExecutionContextView setLocalRepository(MavenRepository localReposit
141141
}
142142

143143
public MavenRepository getLocalRepository() {
144-
return getMessage(MAVEN_LOCAL_REPOSITORY, MAVEN_LOCAL_DEFAULT);
144+
MavenRepository configuredProperty = getMessage(MAVEN_LOCAL_REPOSITORY);
145+
if (configuredProperty != null) {
146+
return configuredProperty;
147+
}
148+
MavenSettings settings = getSettings();
149+
if (settings != null) {
150+
return settings.getMavenLocal();
151+
}
152+
return MAVEN_LOCAL_DEFAULT;
145153
}
146154

147155
public MavenExecutionContextView setAddLocalRepository(boolean useLocalRepository) {

0 commit comments

Comments
 (0)