diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java index 9bf7cd958ca..93d0109666e 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java @@ -141,7 +141,15 @@ public MavenExecutionContextView setLocalRepository(MavenRepository localReposit } public MavenRepository getLocalRepository() { - return getMessage(MAVEN_LOCAL_REPOSITORY, MAVEN_LOCAL_DEFAULT); + MavenRepository configuredProperty = getMessage(MAVEN_LOCAL_REPOSITORY); + if (configuredProperty != null) { + return configuredProperty; + } + MavenSettings settings = getSettings(); + if (settings != null) { + return settings.getMavenLocal(); + } + return MAVEN_LOCAL_DEFAULT; } public MavenExecutionContextView setAddLocalRepository(boolean useLocalRepository) {