我在我的项目中使用 IntelliJ 中的 OpenRewrite。
这是插件的 Maven 配置
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.8.1</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.migrate.UpgradeToJava11</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</plugin>
当我通过控制台和 IntelliJ 运行
rewrite:run
任务时,它给了我这个错误
执行goal的default-cli org.openrewrite.maven:rewrite-maven-plugin:5.8.1:运行失败:无法 在插件中加载 mojo 'run' 'org.openrewrite.maven:rewrite-maven-plugin:5.8.1' 由于 API 不兼容: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/openrewrite/maven/RewriteRunMojo :不支持的major.minor版本 52.0
我尝试过更改Java版本,但没有结果。我找不到问题。