我正在尝试使用食谱:
- org.openrewrite.java.spring.CommentOutSpringPropertyKey:
propertyKey: spring.datasource.hikari.auto-commit
comment: "Use Oracle JDBC driver connection property autoCommit."
但是运行时出现以下错误:
"src/main/resources/application.yaml","org.openrewrite.java.spring.CommentOutSpringPropertyKey","java.lang.NoSuchMethodError: 'void org.openrewrite.yaml.CommentOutProperty.<init>(java.lang.String, java.lang.String)'
org.openrewrite.java.spring.CommentOutSpringPropertyKey.getVisitor(CommentOutSpringPropertyKey.java:53)
org.openrewrite.scheduling.RecipeRunCycle.lambda$editSources$7(RecipeRunCycle.java:178)
org.openrewrite.scheduling.RecipeStack.reduce(RecipeStack.java:57)
org.openrewrite.scheduling.RecipeRunCycle.lambda$editSources$8(RecipeRunCycle.java:155)
org.openrewrite.internal.InMemoryLargeSourceSet.lambda$edit$0(InMemoryLargeSourceSet.java:66)
org.openrewrite.internal.ListUtils.map(ListUtils.java:243)
org.openrewrite.internal.ListUtils.map(ListUtils.java:265)
org.openrewrite.internal.InMemoryLargeSourceSet.edit(InMemoryLargeSourceSet.java:65)
org.openrewrite.scheduling.RecipeRunCycle.editSources(RecipeRunCycle.java:154)"
我正在使用
org.openrewrite.java.spring.ChangeSpringPropertyValue
、org.openrewrite.java.spring.AddSpringProperty
,没有任何问题。例如:
- org.openrewrite.java.spring.ChangeSpringPropertyValue:
propertyKey: spring.datasource.driver-class-name
newValue: oracle.jdbc.OracleDriver
我不认为这是类路径问题,但我肯定是错的?我的
pom.xml
看起来像这样:
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.46.3</version>
<configuration>
<exportDatatables>true</exportDatatables>
<activeRecipes>
<recipe>com.oracle.spring.hikaritoucp</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java</artifactId>
<version>8.41.3</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>5.24.1</version>
</dependency>
</dependencies>
</plugin>
该食谱上周已更改:https://github.com/openrewrite/rewrite-spring/commit/6738e13197a3f734fc9608f38349ebe3b4d27761
您需要使用最新的 rewrite-spring SNAPSHOT 或将 Maven 插件降级到 v5.46.1,直到下一个版本(可能是明天)。