Adopt rewrite changes
This commit is contained in:
@@ -82,21 +82,12 @@
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.openrewrite.recipe</groupId>
|
||||
<artifactId>rewrite-spring</artifactId>
|
||||
<version>${rewrite-spring-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.openrewrite.recipe/rewrite-migrate-java -->
|
||||
<dependency>
|
||||
<groupId>org.openrewrite.recipe</groupId>
|
||||
<artifactId>rewrite-migrate-java</artifactId>
|
||||
<version>${rewrite-java-migration.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -20,10 +20,12 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.openrewrite.Contributor;
|
||||
import org.openrewrite.Recipe;
|
||||
import org.openrewrite.config.CategoryDescriptor;
|
||||
import org.openrewrite.config.DeclarativeRecipe;
|
||||
@@ -49,7 +51,8 @@ public class StsClasspathScanningLoader implements ResourceLoader, StsResourceLo
|
||||
|
||||
private final List<RecipeDescriptor> recipeDescriptors = new ArrayList<>();
|
||||
private final List<CategoryDescriptor> categoryDescriptors = new ArrayList<>();
|
||||
private final List<RecipeExample> recipeExamples = new ArrayList<>();
|
||||
private final Map<String, List<Contributor>> recipeAttributions = new HashMap<>();
|
||||
private final Map<String, List<RecipeExample>> recipeExamples = new HashMap<>();
|
||||
|
||||
private final List<CodeActionRepository> codeActionRepos = new ArrayList<>();
|
||||
|
||||
@@ -124,10 +127,11 @@ public class StsClasspathScanningLoader implements ResourceLoader, StsResourceLo
|
||||
recipes.addAll(resourceLoader.listRecipes());
|
||||
categoryDescriptors.addAll(resourceLoader.listCategoryDescriptors());
|
||||
styles.addAll(resourceLoader.listStyles());
|
||||
recipeExamples.addAll(resourceLoader.listRecipeExamples());
|
||||
recipeAttributions.putAll(resourceLoader.listContributors());
|
||||
recipeExamples.putAll(resourceLoader.listRecipeExamples());
|
||||
}
|
||||
for(YamlResourceLoader resourceLoader : yamlResourceLoaders) {
|
||||
recipeDescriptors.addAll(resourceLoader.listRecipeDescriptors(recipes, new HashMap<>()));
|
||||
recipeDescriptors.addAll(resourceLoader.listRecipeDescriptors(recipes, recipeAttributions, recipeExamples));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,8 +206,7 @@ public class StsClasspathScanningLoader implements ResourceLoader, StsResourceLo
|
||||
return styles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<RecipeExample> listRecipeExamples() {
|
||||
public Map<String, List<RecipeExample>> listRecipeExamples() {
|
||||
return recipeExamples;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,11 @@ public class MavenProjectParserTest {
|
||||
MavenParser.Builder mavenParserBuilder = MavenParser.builder()
|
||||
.mavenConfig(testProjectPath.resolve(".mvn/maven.config"));
|
||||
|
||||
MavenProjectParser parser = new MavenProjectParser(mavenParserBuilder, JavaParser.fromJavaVersion(), new InMemoryExecutionContext(), null);
|
||||
MavenProjectParser parser = new MavenProjectParser(mavenParserBuilder, JavaParser.fromJavaVersion(), new InMemoryExecutionContext(t -> {
|
||||
if (t instanceof Error) {
|
||||
throw new RuntimeException(t);
|
||||
};
|
||||
}), null);
|
||||
|
||||
List<SourceFile> sources = parser.parse(testProjectPath, Collections.emptyList());
|
||||
|
||||
|
||||
@@ -110,7 +110,6 @@
|
||||
<!-- Rewrite specific properties -->
|
||||
<rewrite-version>7.39.0-SNAPSHOT</rewrite-version>
|
||||
<rewrite-spring-version>4.35.0-SNAPSHOT</rewrite-spring-version>
|
||||
<rewrite-java-migration.version>1.19.0-SNAPSHOT</rewrite-java-migration.version>
|
||||
|
||||
<signing.skip>true</signing.skip>
|
||||
<signing.alias>vmware</signing.alias>
|
||||
|
||||
Reference in New Issue
Block a user