Skip to content

Commit

Permalink
Add local repo to ExecutionContext
Browse files Browse the repository at this point in the history
hoping to fix non-resolvable local project issue
  • Loading branch information
fabapp2 committed Aug 2, 2023
1 parent 100198a commit 59bb831
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
import org.openrewrite.SourceFile;
import org.openrewrite.marker.Marker;
import org.openrewrite.maven.AbstractRewriteMojo;
import org.openrewrite.maven.MavenExecutionContextView;
import org.openrewrite.maven.MavenMojoProjectParser;
import org.openrewrite.maven.tree.MavenRepository;
import org.openrewrite.style.NamedStyles;
import org.openrewrite.tree.ParsingEventListener;
import org.openrewrite.tree.ParsingExecutionContextView;
Expand Down Expand Up @@ -84,7 +86,7 @@ public RewriteProjectParsingResult parse(Path baseDir, List<Resource> resources,
if(!baseDir.isAbsolute()) {
baseDir = baseDir.toAbsolutePath().normalize();
}

MavenExecutionContextView.view(executionContext).setLocalRepository(new MavenRepository("local", "file://" + Path.of(System.getProperty("user.home")).resolve(".m2/repository"), null, null, false, null, null, null));
eventPublisher.publishEvent(new StartedParsingProjectEvent(resources));

ParsingExecutionContextView.view(executionContext).setParsingListener(parsingEventListener);
Expand Down

0 comments on commit 59bb831

Please sign in to comment.