Я есть на Intellij Idea 2025.1.2 с плагином Openrewrite в комплекте 251.26094.121Java 18 и Gradle 7.6.5. Я пытаюсь обновить Spring Boot от версии 3.3.12 до версии 3.4, но OpenRewrite возвращает следующую ошибку: < /p>
15:07:12: Executing 'rewriteRun'…
> Task :compileJava
Note: C:\Users\UserName\IdeaProjects\test-project\src\main\java\com\test\contactdata\controller\util\CrmFormatterUtils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :processResources
> Task :classes
> Task :compileTestJava
> Task :rewriteRun
Validating active recipes
Scanning sources in project :
Using active styles []
There were problems parsing some source files, run with --info to see full stack traces
There were problems parsing Test_DevOps\helm\test-project\templates\deployment.yaml
There were problems parsing Test_DevOps\helm\test-project\templates\hpa.yaml
There were problems parsing Test_DevOps\helm\test-project\templates\ingress.yaml
There were problems parsing Test_DevOps\helm\test-project\templates\secretproviderclass.yaml
There were problems parsing Test_DevOps\helm\test-project\templates\service.yaml
There were problems parsing Test_DevOps\helm\test-project\templates\serviceaccount.yaml
All sources parsed, running active recipes: org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4
The recipe produced an error. Please report this to the recipe author.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rewriteRun'.
> java.lang.RuntimeException: Error while visiting build.gradle: java.lang.NullPointerException: Cannot invoke "java.util.Set.stream()" because the return value of "java.util.Map.remove(Object)" is null
org.openrewrite.gradle.search.DependencyInsight$MarkIndividualDependency.lambda$visitMethodInvocation$4(DependencyInsight.java:237)
java.base/java.util.Optional.map(Optional.java:260)
org.openrewrite.gradle.search.DependencyInsight$MarkIndividualDependency.visitMethodInvocation(DependencyInsight.java:230)
org.openrewrite.gradle.search.DependencyInsight$MarkIndividualDependency.visitMethodInvocation(DependencyInsight.java:192)
org.openrewrite.java.tree.J$MethodInvocation.acceptJava(J.java:4281)
org.openrewrite.java.tree.J.accept(J.java:63)
org.openrewrite.TreeVisitor.visit(TreeVisitor.java:245)
org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:311)
org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1380)
org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:400)
org.openrewrite.internal.ListUtils.map(ListUtils.java:244)
org.openrewrite.internal.ListUtils.map(ListUtils.java:267)
org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:399)
org.openrewrite.java.JavaIsoVisitor.visitBlock(JavaIsoVisitor.java:88)
org.openrewrite.java.JavaIsoVisitor.visitBlock(JavaIsoVisitor.java:30)
org.openrewrite.java.tree.J$Block.acceptJava(J.java:851)
...
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2m 43s
> Task :rewriteRun FAILED
4 actionable tasks: 4 executed
15:09:56: Execution finished 'rewriteRun'.
< /code>
К сожалению, сообщение об ошибке не помогает. Что может здесь проблема? Я также попробовал, удалив файлы Helm, и с другой версией Gradle, но это тоже не помогло.plugins {
id 'org.springframework.boot' version '3.3.12'
id 'io.spring.dependency-management' version '1.1.7'
id 'java'
id 'org.sonarqube' version '3.5.0.2730'
}
group = 'com.test'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(18)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-freemarker'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'io.hypersistence:hypersistence-utils-hibernate-63:3.8.3'
implementation "jakarta.validation:jakarta.validation-api:3.0.2"
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.apache.commons:commons-lang3:3.15.0'
implementation 'org.apache.httpcomponents.client5:httpclient5'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-sqlserver'
implementation 'org.keycloak:keycloak-admin-client:16.1.0'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.14.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.13.40'
implementation "commons-codec:commons-codec:1.17.2"
implementation 'com.google.guava:guava:33.3.1-jre'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.microsoft.sqlserver:mssql-jdbc:10.2.1.jre17'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
У меня также есть приложение Spring Boot 3.3.10, и я снова хочу обновить его до версии 3.4. Java 18, Gradle 7.5. OpenRewrite снова возвращает следующую ошибку: < /p>
15:48:54: Executing 'rewriteRun'…
Starting Gradle Daemon...
Gradle Daemon started in 5 s 716 ms
Download https://plugins.gradle.org/m2/org/openr ... tadata.xml, took 59 ms
> Task :compileJava
C:\Users\UserName\IdeaProjects\test-project\test-project\src\main\java\com\test\client\configuration\security\ResourceServerConfig.java:43: warning: [removal] csrf() in HttpSecurity has been deprecated and marked for removal
.csrf().disable()
^
C:\Users\UserName\IdeaProjects\test-project\test-project\src\main\java\com\test\client\configuration\security\ResourceServerConfig.java:45: warning: [removal] oauth2ResourceServer() in HttpSecurity has been deprecated and marked for removal
.oauth2ResourceServer()
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\UserName\IdeaProjects\test-project\test-project\src\main\java\com\test\client\service\backend\client\MixedMultiplartFormHttpMessageConverter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 warnings
> Task :processResources
> Task :classes
> Task :compileTestJava
> Task :rewriteRun
Validating active recipes
Scanning sources in project :
Using active styles []
All sources parsed, running active recipes: org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4
The recipe produced an error. Please report this to the recipe author.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rewriteRun'.
> java.lang.RuntimeException: Error while visiting test-project\build.gradle: java.lang.NullPointerException: Cannot invoke "java.util.Set.stream()" because the return value of "java.util.Map.remove(Object)" is null
org.openrewrite.gradle.search.DependencyInsight$MarkIndividualDependency.lambda$visitMethodInvocation$4(DependencyInsight.java:237)
java.base/java.util.Optional.map(Optional.java:260)
org.openrewrite.gradle.search.DependencyInsight$MarkIndividualDependency.visitMethodInvocation(DependencyInsight.java:230)
org.openrewrite.gradle.search.DependencyInsight$MarkIndividualDependency.visitMethodInvocation(DependencyInsight.java:192)
org.openrewrite.java.tree.J$MethodInvocation.acceptJava(J.java:4281)
org.openrewrite.java.tree.J.accept(J.java:63)
org.openrewrite.TreeVisitor.visit(TreeVisitor.java:245)
org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:311)
org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1380)
org.openrewrite.java.JavaVisitor.lambda$visitBlock$4(JavaVisitor.java:400)
org.openrewrite.internal.ListUtils.map(ListUtils.java:244)
org.openrewrite.internal.ListUtils.map(ListUtils.java:267)
org.openrewrite.java.JavaVisitor.visitBlock(JavaVisitor.java:399)
org.openrewrite.java.JavaIsoVisitor.visitBlock(JavaIsoVisitor.java:88)
org.openrewrite.java.JavaIsoVisitor.visitBlock(JavaIsoVisitor.java:30)
org.openrewrite.java.tree.J$Block.acceptJava(J.java:851)
...
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3m 58s
> Task :rewriteRun FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5/userguide/c ... e_warnings
4 actionable tasks: 4 executed
15:52:57: Execution finished 'rewriteRun'.
< /code>
На самом деле позже я исправил предупреждения, но опять же, это не помогло. Что я делаю здесь не так?plugins {
id 'java'
id 'org.springframework.boot' version '3.3.10'
id 'io.spring.dependency-management' version '1.1.0'
id "jacoco"
id 'org.sonarqube' version '3.5.0.2730'
}
group = 'com.test'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(18)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.data:spring-data-commons:3.1.12'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.2.1'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.apache.poi:poi-ooxml:5.3.0'
implementation 'com.ibm.icu:icu4j:75.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.1'
implementation 'com.itextpdf:itextpdf:5.5.13.4'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
implementation 'org.keycloak:keycloak-admin-client:16.1.0'
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
jacocoTestReport {
reports {
xml.enabled true
}
}
tasks.named('test', Test) {
useJUnitPlatform()
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... set-stream