Skip to content

Reusable Execution Context #792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
0eb4810
Introducting Arch rule to control creation of Execution context object
sanagaraj-pivotal May 10, 2023
a1ea80b
Arch rule: Exclude test classes
sanagaraj-pivotal May 10, 2023
e1e081f
Arch rule: Exclude particular class
sanagaraj-pivotal May 10, 2023
7b10622
Arch rule: Exclude test classes
sanagaraj-pivotal May 10, 2023
18e3b11
wip: Recipe Scope works and test exists
fabapp2 May 10, 2023
5d47ede
wip: Adds comments in the test to define what the test should verify
fabapp2 May 11, 2023
d8c795b
wip: Test verifies behaviour with custom classes
fabapp2 May 12, 2023
a9864e8
wip...
fabapp2 May 15, 2023
40f2972
wip
fabapp2 May 15, 2023
389467a
wip: cleanup and formatting
fabapp2 May 16, 2023
2caf989
refact: Replace ExecutionContext instance creations with di in Spring…
fabapp2 May 16, 2023
c7aaafe
format:
fabapp2 May 16, 2023
6e3ee6e
refact: Replace ExecutionContext instance creations with di in MavenB…
fabapp2 May 16, 2023
408eb3d
refact: Replace ExecutionContext instance creations with di in AddMin…
fabapp2 May 16, 2023
b71c357
refact: Replace ExecutionContext instance creations with di in TestPr…
fabapp2 May 16, 2023
ea5204a
refact: Replace ExecutionContext instance creations with di in Rewrit…
fabapp2 May 16, 2023
80fc611
refact: Replace ExecutionContext instance creations with di in Depend…
fabapp2 May 16, 2023
b49a961
refact: Replace ExecutionContext instance creations with di in Depend…
fabapp2 May 16, 2023
627de98
refact: Replace ExecutionContext instance creations with di in OpenRe…
fabapp2 May 16, 2023
516bee5
refact: Replace ExecutionContext instance creations with di in OpenRe…
fabapp2 May 16, 2023
4a79331
refact: Replace ExecutionContext instance creations with di in more c…
fabapp2 May 16, 2023
f90bc3d
refact: Replace ExecutionContext instance creations with di in more c…
fabapp2 May 16, 2023
9405581
refact: Replace ExecutionContext instance creations with di in more c…
fabapp2 May 16, 2023
4f75a90
Delete test that will become obsolete
fabapp2 May 16, 2023
926d49d
refactor: Switch to ActionTest for DI of ExecutionContext
fabapp2 May 22, 2023
de854a0
test: Add test helper for Actions depending on Spring beans
fabapp2 May 22, 2023
256a51a
fix: Parsing erroneous resources in src/test/res.. should not fail pa…
fabapp2 May 22, 2023
42a6a1d
Because TestProjectContext uses Spring now ApplicationEventPublisher …
fabapp2 May 22, 2023
67b8877
fix: Fixing injection point by adding final to member
fabapp2 May 22, 2023
e4fee3f
cleanup: Remove unused code
fabapp2 May 22, 2023
2580b04
doc: Add license header
fabapp2 May 22, 2023
decd83f
test: Fix ApplyCommandTest by mocking new dependencies
fabapp2 May 22, 2023
5ed59dd
test: Adjust assertion in RewriteJavaParserTest
fabapp2 May 22, 2023
d090807
test: Add new beans to list in @SpringBootTest
fabapp2 May 22, 2023
7cfdad5
test: Add new beans to list in @SpringBootTest
fabapp2 May 22, 2023
fb215ca
test: Using system property for java.version instead of fixed version
fabapp2 May 22, 2023
14ae7c9
test: Fix test by adding missing dependencies
fabapp2 May 22, 2023
452a451
Remove RewriteExecutionContextFactory
fabapp2 May 22, 2023
287b3ee
cleanup: Remove unused code
fabapp2 May 23, 2023
f593800
clean: Remove unused code and import
fabapp2 May 23, 2023
6a726a8
refact: ScopeConfiguration also defines scoped beans
fabapp2 May 23, 2023
a607ab2
TestProjectContext currently scans org.springframework.sbm and the te…
fabapp2 May 23, 2023
028a081
test: Adjust test to allow creation of InMemoryExecutionContext in Re…
fabapp2 May 23, 2023
4a55468
refact: SpringBeanProvider uses BeanFactory from ApplicationContext
fabapp2 May 23, 2023
307715f
style: Cleanup order of elements
fabapp2 May 23, 2023
a2fb732
clean: Organized imports
fabapp2 May 23, 2023
b7dde89
test: Remove beans now created in configuration class from the list o…
fabapp2 May 23, 2023
d438b81
test: Reuse ArchUnit test from core to prevent ExecutionContext creation
fabapp2 May 23, 2023
43ee374
fix: Switch Archunit from Junit4 to Junit5
fabapp2 May 23, 2023
c2ee6ff
doc: Add copyright header
fabapp2 May 23, 2023
b387da0
refactor: Replace instance creations of ExecutionContext
fabapp2 May 23, 2023
fc4d36a
test: Add missing bean to ApplicationContext
fabapp2 May 23, 2023
9a212b9
refactor: Replace instance creations of ExecutionContext
fabapp2 May 23, 2023
c9adbd6
clean: Remove unused code and import
fabapp2 May 25, 2023
249cbf8
refact: Add null check for ExecutionContext
fabapp2 May 25, 2023
13b031f
fix: Replace programmatically created ExecutionContext with Spring ma…
fabapp2 May 25, 2023
41f6cab
fix: Using ActionTest for Action requiring ExecutionContext
fabapp2 May 25, 2023
bceddb7
This is required because (other than with spring-test framework annot…
fabapp2 May 25, 2023
67a036a
style: Cleanup pom
fabapp2 May 25, 2023
18a18c2
test: Add scope related beans to ApplicationContext used in test
fabapp2 May 25, 2023
d16f100
test: MigrateMulesoftFile action requires ExecutionContext
fabapp2 May 25, 2023
90a97af
test: Reuse ArchUnit test from core
fabapp2 May 25, 2023
25386d8
test: RewriteJavaParser requires ExecutionContext
fabapp2 May 25, 2023
2fdddb9
test: SpringBootApplicationPropertiesRegistrar requires ExecutionContext
fabapp2 May 25, 2023
db2f990
test: Add freemarker Configuration to ApplicationContext created in T…
fabapp2 May 25, 2023
a3b4220
refact: Add null checks
fabapp2 May 25, 2023
9c54c68
wip: Mule test refactored
fabapp2 May 25, 2023
8a180ab
fix: Adjust mule file filter condition to recognize <mule\n too
fabapp2 May 26, 2023
6121d54
test: fix test
sanagaraj-pivotal May 26, 2023
563e6ac
test: fix test
sanagaraj-pivotal May 26, 2023
16791b8
test: Use ActionTest for action that requires ExecutionContext
fabapp2 May 26, 2023
aa23792
format: Indent
fabapp2 May 26, 2023
4b28bb8
test: Fix assertion
fabapp2 May 26, 2023
1c4e4b9
format: Fix testcode formatting
fabapp2 May 26, 2023
ff860e6
cleanup: Remove dead code
fabapp2 May 26, 2023
d43c94c
Merge branch 'main' into 786-reusable-execution-context
fabapp2 May 26, 2023
aa1ec4a
test: Add ArchUnit test checking for new ExecutionContext instance cr…
fabapp2 May 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions applications/spring-shell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@
<artifactId>sbm-recipes-boot-upgrade</artifactId>
<version>0.13.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.sbm</groupId>
<artifactId>sbm-core</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2021 - 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.architecture;

import com.tngtech.archunit.core.importer.ImportOption;
import com.tngtech.archunit.junit.AnalyzeClasses;
import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.junit.ArchTests;

/**
* @author Fabian Krüger
*/
@AnalyzeClasses(packages = {"org.springframework.sbm", "org.openrewrite"}, importOptions = {ImportOption.DoNotIncludeTests.class, ImportOption.DoNotIncludeJars.class})
public class FindIllegalExecutionContextCreationsTest {
@ArchTest
static final ArchTests executionContextMustNotBeCreatedWithNew = ArchTests.in(
ControlledInstantiationOfExecutionContextTest.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import static org.assertj.core.api.Assertions.assertThat;

class ScanCommandHeaderRendererTest {
class ApplyRecipeCommandHeaderRendererTest {

@Test
void renderHeader() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
package org.springframework.sbm.spring.migration.actions;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openrewrite.ExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.sbm.engine.recipe.AbstractAction;
import org.springframework.sbm.engine.recipe.UserInteractions;
import org.springframework.sbm.common.migration.conditions.FileExist;
Expand All @@ -28,9 +31,12 @@
public class InitDataSourceAfterJpaInitAction extends AbstractAction {

public static final String QUESTION = "Would you rather run the SQL init scripts after JPA initialization?";

private final UserInteractions ui;

@Autowired
@JsonIgnore
private ExecutionContext executionContext;

public InitDataSourceAfterJpaInitAction(UserInteractions ui) {
this.ui = ui;
setCondition(FileExist.builder().fileName("data.sql").build().or(FileExist.builder().fileName("schema.sql").build()));
Expand All @@ -44,7 +50,7 @@ public void apply(ProjectContext context) {
SpringBootApplicationProperties applicationProperties;
if (filteredResources.isEmpty()) {
Path path = context.getBuildFile().getResourceFolders().get(0).resolve("application.properties");
applicationProperties = SpringBootApplicationProperties.newApplicationProperties(context.getProjectRootDirectory(), path);
applicationProperties = SpringBootApplicationProperties.newApplicationProperties(context.getProjectRootDirectory(), path, executionContext);
context.getProjectResources().add(applicationProperties);
} else {
applicationProperties = filteredResources.get(0);
Expand Down
2 changes: 1 addition & 1 deletion components/recipe-test-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<dependency>
<groupId>org.springframework.sbm</groupId>
<artifactId>sbm-core</artifactId>
<version>0.13.1-SNAPSHOT</version>
<version>${project.version}</version>
<type>test-jar</type>
<scope>compile</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import org.springframework.sbm.project.resource.ProjectResourceSetHolder;
import org.springframework.sbm.project.resource.SbmApplicationProperties;
import org.springframework.sbm.project.resource.ResourceHelper;
import org.springframework.sbm.scopeplayground.ExecutionScope;
import org.springframework.sbm.scopeplayground.ScanScope;
import org.springframework.sbm.scopeplayground.ScopeConfiguration;
import org.springframework.sbm.search.recipe.actions.OpenRewriteJavaSearchAction;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -77,7 +80,10 @@ private RecipeTestSupport() {
RewriteMavenParser.class,
MavenSettingsInitializer.class,
MavenBuildFileRefactoringFactory.class,
ProjectResourceSetHolder.class
ProjectResourceSetHolder.class,
ScopeConfiguration.class,
ExecutionScope.class,
ScanScope.class
};


Expand Down

This file was deleted.

15 changes: 14 additions & 1 deletion components/sbm-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>

<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down Expand Up @@ -175,7 +182,13 @@
</goals>
</execution>
</executions>
<configuration>
<excludes>
<!-- Would be picked up by component scan in other modules -->
<exclude>**/org/springframework/sbm/archfitfun/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.springframework.sbm.build.api;

import org.openrewrite.ExecutionContext;
import org.openrewrite.java.JavaParser;
import org.openrewrite.maven.tree.MavenResolutionResult;
import org.springframework.sbm.build.impl.JavaSourceSetImpl;
Expand Down Expand Up @@ -55,6 +56,7 @@ public class Module {
private final JavaRefactoringFactory javaRefactoringFactory;
private final BasePackageCalculator basePackageCalculator;
private final JavaParser javaParser;
private final ExecutionContext executionContext;

public JavaSourceLocation getBaseJavaSourceLocation() {
return getMainJavaSourceSet().getJavaSourceLocation();
Expand All @@ -67,7 +69,8 @@ public JavaSourceLocation getBaseTestJavaSourceLocation() {
public JavaSourceSet getTestJavaSourceSet() {
Path testJavaPath = Path.of("src/test/java");
// FIXME: #7 JavaParser
return new JavaSourceSetImpl(projectResourceSet, projectRootDir, modulePath, testJavaPath, javaRefactoringFactory, basePackageCalculator, javaParser);
return new JavaSourceSetImpl(projectResourceSet, projectRootDir, modulePath, testJavaPath, javaRefactoringFactory, basePackageCalculator, javaParser,
executionContext);
}

public List<? extends JavaSource> getMainJavaSources() {
Expand All @@ -83,7 +86,8 @@ public List<? extends JavaSource> getTestJavaSources() {
public JavaSourceSet getMainJavaSourceSet() {
Path mainJavaPath = Path.of("src/main/java");
// return new JavaSourceSetImpl(projectResourceSet, projectRootDir.resolve(modulePath).resolve(mainJavaPath), javaRefactoringFactory);
return new JavaSourceSetImpl(projectResourceSet, projectRootDir, modulePath, mainJavaPath, javaRefactoringFactory, basePackageCalculator, javaParser);
return new JavaSourceSetImpl(projectResourceSet, projectRootDir, modulePath, mainJavaPath, javaRefactoringFactory, basePackageCalculator, javaParser,
executionContext);
}

private List<JavaSource> cast(List<RewriteSourceFileHolder<? extends SourceFile>> filter) {
Expand Down Expand Up @@ -112,12 +116,12 @@ public Path getProjectRootDirectory() {

public ResourceSet getMainResourceSet() {
Path mainResourceSet = buildFile.getMainResourceFolder();
return new ResourceSet(projectResourceSet, projectRootDir, modulePath, mainResourceSet);
return new ResourceSet(projectResourceSet, projectRootDir, modulePath, mainResourceSet, executionContext);
}

public ResourceSet getTestResourceSet() {
Path testResourceSet = buildFile.getTestResourceFolder();
return new ResourceSet(projectResourceSet, projectRootDir, modulePath, testResourceSet);
return new ResourceSet(projectResourceSet, projectRootDir, modulePath, testResourceSet, executionContext);
}

public List<Module> getModules() {
Expand All @@ -127,7 +131,7 @@ public List<Module> getModules() {
return modulesMarker
.stream()
.map(m -> new Module(m.getPom().getGav().toString(), this.buildFile, projectRootDir, modulePath,
projectResourceSet, javaRefactoringFactory, basePackageCalculator, javaParser))
projectResourceSet, javaRefactoringFactory, basePackageCalculator, javaParser, executionContext))
.collect(Collectors.toList());
} else {
return new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.springframework.sbm.build.api;

import org.openrewrite.ExecutionContext;
import org.springframework.sbm.project.resource.ProjectResourceSet;
import org.springframework.sbm.project.resource.RewriteSourceFileHolder;
import org.springframework.sbm.project.resource.StringProjectResource;
Expand All @@ -30,10 +31,11 @@ public class ResourceSet {
private final Path projectRoot;
private final Path modulePath;
private final Path resourceSetPath;
private final ExecutionContext executionContext;

public void addStringResource(String filePath, String content) {
Path absFilePath = getAbsolutePath().resolve(filePath);
StringProjectResource resource = new StringProjectResource(projectRoot, absFilePath, content);
StringProjectResource resource = new StringProjectResource(projectRoot, absFilePath, content, executionContext);
resource.markAsChanged();
projectResourceSet.add(resource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package org.springframework.sbm.build.api;

import org.openrewrite.ExecutionContext;
import org.openrewrite.maven.MavenDownloadingException;
import org.openrewrite.maven.internal.MavenPomDownloader;
import org.openrewrite.maven.tree.GroupArtifactVersion;
import org.openrewrite.maven.tree.MavenRepository;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;

import java.util.Collections;
import java.util.HashMap;
Expand All @@ -39,17 +39,17 @@ public class SpringManagedDependencies {
private List<org.openrewrite.maven.tree.Dependency> dependencies;
private static Map<GroupArtifactVersion, SpringManagedDependencies> INSTANCES = new HashMap<>();

public static SpringManagedDependencies by(String groupId, String artifact, String version){
public static SpringManagedDependencies by(String groupId, String artifact, String version, ExecutionContext executionContext){
final GroupArtifactVersion groupArtifactVersion =
new GroupArtifactVersion(groupId, artifact, version);

INSTANCES.computeIfAbsent(groupArtifactVersion, SpringManagedDependencies::new);
INSTANCES.computeIfAbsent(groupArtifactVersion, gav -> new SpringManagedDependencies(gav, executionContext));
return INSTANCES.get(groupArtifactVersion);
}

private SpringManagedDependencies(GroupArtifactVersion groupArtifactVersion){
private SpringManagedDependencies(GroupArtifactVersion groupArtifactVersion, ExecutionContext executionContext){
try {
dependencies = new MavenPomDownloader(Collections.emptyMap(), new RewriteExecutionContext())
dependencies = new MavenPomDownloader(Collections.emptyMap(), executionContext)
.download(groupArtifactVersion, null, null, SPRING_REPOSITORIES)
.getDependencies();
} catch (MavenDownloadingException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.springframework.sbm.build.impl;

import org.openrewrite.ExecutionContext;
import org.springframework.sbm.build.api.JavaSourceSet;
import org.springframework.sbm.java.api.JavaSource;
import org.springframework.sbm.java.api.JavaSourceLocation;
Expand Down Expand Up @@ -44,11 +45,13 @@ public class JavaSourceSetImpl implements JavaSourceSet {
private final JavaRefactoringFactory javaRefactoringFactory;
private final BasePackageCalculator basePackageCalculator;
private final JavaParser javaParser;
private ExecutionContext executionContext;

public JavaSourceSetImpl(ProjectResourceSet projectResourceSet, Path projectRootDir, Path modulePath, Path mainJavaPath, JavaRefactoringFactory javaRefactoringFactory, BasePackageCalculator basePackageCalculator, JavaParser javaParser) {
public JavaSourceSetImpl(ProjectResourceSet projectResourceSet, Path projectRootDir, Path modulePath, Path mainJavaPath, JavaRefactoringFactory javaRefactoringFactory, BasePackageCalculator basePackageCalculator, JavaParser javaParser, ExecutionContext executionContext) {
this.projectResourceSet = projectResourceSet;
this.basePackageCalculator = basePackageCalculator;
this.javaParser = javaParser;
this.executionContext = executionContext;
this.sourceSetRoot = projectRootDir.resolve(modulePath).resolve(mainJavaPath);
this.filter = (r) -> {
return r.getAbsolutePath().getParent().normalize().toString().startsWith(sourceSetRoot.toString());
Expand All @@ -73,7 +76,7 @@ public JavaSource addJavaSource(Path projectRoot, Path sourceFolder, String sour
throw new RuntimeException("The Java class you tried to add already lives here: '" + sourceFilePath + "'.");
} else {
J.CompilationUnit compilationUnit = parsedCompilationUnit.withSourcePath(sourceFilePath);
OpenRewriteJavaSource addedSource = new OpenRewriteJavaSource(projectRoot, compilationUnit, javaRefactoringFactory.createRefactoring(compilationUnit), javaParser);
OpenRewriteJavaSource addedSource = new OpenRewriteJavaSource(projectRoot, compilationUnit, javaRefactoringFactory.createRefactoring(compilationUnit), javaParser, executionContext);
addedSource.markChanged();
projectResourceSet.add(addedSource);
return addedSource;
Expand All @@ -94,7 +97,7 @@ public List<JavaSource> addJavaSource(Path projectRoot, Path sourceFolder, Strin
Path sourceFilePath = sourceFolder.resolve(sourceFileName);
if(!Files.exists(sourceFilePath)) {
J.CompilationUnit compilationUnit = cu.withSourcePath(sourceFilePath);
OpenRewriteJavaSource addedSource = new OpenRewriteJavaSource(projectRoot, compilationUnit, javaRefactoringFactory.createRefactoring(compilationUnit), javaParser);
OpenRewriteJavaSource addedSource = new OpenRewriteJavaSource(projectRoot, compilationUnit, javaRefactoringFactory.createRefactoring(compilationUnit), javaParser, executionContext);
addedSource.markChanged();
projectResourceSet.add(addedSource);
addedSources.add(addedSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
import org.jetbrains.annotations.NotNull;
import org.openrewrite.*;
import org.openrewrite.marker.Markers;
import org.openrewrite.marker.SearchResult;
import org.openrewrite.maven.MavenVisitor;
import org.openrewrite.maven.tree.MavenResolutionResult;
import org.openrewrite.xml.tree.Xml;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.project.resource.ProjectResourceSet;
import org.springframework.sbm.project.resource.RewriteSourceFileHolder;
import org.springframework.sbm.support.openrewrite.GenericOpenRewriteRecipe;
Expand All @@ -46,6 +44,7 @@
public class MavenBuildFileRefactoring<T extends SourceFile> {
private final ProjectResourceSet projectResourceSet;
private final RewriteMavenParser mavenParser;
private final ExecutionContext executionContext;

/**
* Applies the provided {@code Visitor}s to all Maven build files in the {@code ProjectContext}.
Expand Down Expand Up @@ -107,7 +106,7 @@ public void refreshPomModels() {
.collect(Collectors.toList());

// parse buildfiles
List<Xml.Document> newMavenFiles = mavenParser.parseInputs(parserInputs, null, new RewriteExecutionContext());
List<Xml.Document> newMavenFiles = mavenParser.parseInputs(parserInputs, null, executionContext);

// replace new model in build files
newMavenFiles.stream()
Expand Down Expand Up @@ -152,12 +151,12 @@ public BuildFileWithIndex(int index, RewriteSourceFileHolder<Xml.Document> xmlDo
}

private List<Result> executeRecipe(Recipe recipe) {
List<Result> results = recipe.run(getDocumentsWrappedInOpenRewriteMavenBuildFile(), new RewriteExecutionContext()).getResults();
List<Result> results = recipe.run(getDocumentsWrappedInOpenRewriteMavenBuildFile(), executionContext).getResults();
return results;
}

private List<Result> executeRecipe(Recipe recipe, RewriteSourceFileHolder<Xml.Document> resource) {
List<Result> results = recipe.run(List.of(resource.getSourceFile()), new RewriteExecutionContext()).getResults();
List<Result> results = recipe.run(List.of(resource.getSourceFile()), executionContext).getResults();
return results;
}

Expand Down
Loading