From cc6d27a181a955480a5c89ff4f04db96a2145d42 Mon Sep 17 00:00:00 2001 From: mshima <1417183+mshima@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:13:49 +0000 Subject: [PATCH 1/6] update spring-boot-dependencies bom to v3.4.1 --- .../resources/spring-boot-dependencies.pom | 233 +++++++++--------- 1 file changed, 119 insertions(+), 114 deletions(-) diff --git a/generators/spring-boot/resources/spring-boot-dependencies.pom b/generators/spring-boot/resources/spring-boot-dependencies.pom index 5f549562ae9e..1404c05d5d64 100644 --- a/generators/spring-boot/resources/spring-boot-dependencies.pom +++ b/generators/spring-boot/resources/spring-boot-dependencies.pom @@ -3,7 +3,7 @@ 4.0.0 org.springframework.boot spring-boot-dependencies - 3.4.0 + 3.4.1 pom spring-boot-dependencies Spring Boot Dependencies @@ -33,10 +33,10 @@ 1.9.22.1 3.26.3 4.2.2 - 3.4.2 + 3.4.3 6.0.3 3.6.0 - 1.15.10 + 1.15.11 2.6.1.Final 3.1.8 4.18.1 @@ -46,14 +46,14 @@ 3.17.0 1.6 2.12.0 - 3.7.5 + 3.7.6 1.5.0 - 2.9.0 + 2.9.1 11.5.9.0 - 1.1.6 + 1.1.7 10.16.1.1 3.10.8 - 8.15.4 + 8.15.5 10.20.1 2.3.33 9.0.1 @@ -65,8 +65,8 @@ 2.3.232 2.2 5.5.0 - 6.6.2.Final - 8.0.1.Final + 6.6.4.Final + 8.0.2.Final 5.1.0 2.7.3 4.5.0 @@ -76,7 +76,7 @@ 5.3.1 15.0.11.Final 2.24 - 2.18.1 + 2.18.2 2.1.3 2.1.1 2.0.1 @@ -105,22 +105,22 @@ 5.2.0 3.1.9 4.0.8 - 12.0.15 + 12.0.16 1.16 - 3.19.15 + 3.19.16 2.9.0 2.5.1 1.5.3 1.3.1 4.13.2 - 5.11.3 + 5.11.4 3.8.1 1.9.25 1.8.1 1.6.3 6.4.1.RELEASE 4.29.2 - 2.24.1 + 2.24.3 1.5.12 1.18.36 3.4.1 @@ -142,25 +142,25 @@ 3.3.1 3.5.2 3.4.0 - 1.14.1 - 1.4.0 + 1.14.2 + 1.4.1 5.14.2 5.2.1 12.8.1.jre11 9.1.0 - 0.10.3 + 0.10.4 1.9.22 5.25.0 - 4.1.115.Final + 4.1.116.Final 1.43.0 23.5.0.24.07 1.2.0 3.1.7 42.7.4 - 1.3.3 + 1.3.5 0.16.0 - 3.3.2 - 0.5.9 + 3.3.3 + 0.5.10 2.3.2 5.1.0 1.0.0.RELEASE @@ -174,40 +174,40 @@ 5.22.0 0.18.0 1.0.4 - 2024.0.0 + 2024.0.1 5.5.0 1.1.3 - 3.1.9 + 3.1.10 3.0.4 4.25.0 4.25.0 4.10.3 2.0.16 2.3 - 3.2.0 - 1.4.0 - 5.2.0 - 2024.1.0 - 6.2.0 + 3.2.1 + 1.4.1 + 5.2.1 + 2024.1.1 + 6.2.1 1.3.3 - 2.4.0 - 6.4.0 - 3.3.0 - 3.2.8 - 1.2.0 + 2.4.1 + 6.4.1 + 3.3.1 + 3.2.10 + 1.2.1 3.0.3 - 2.0.10 - 6.4.1 - 3.4.0 + 2.0.11 + 6.4.2 + 3.4.1 4.0.11 - 3.47.0.0 + 3.47.1.0 1.20.4 2.2.2 - 3.1.2.RELEASE + 3.1.3.RELEASE 2.0.1 - 3.1.2.RELEASE + 3.1.3.RELEASE 3.3.0 - 10.1.33 + 10.1.34 6.0.11 2.3.18.Final 2.17.1 @@ -1120,6 +1120,11 @@ kafka-raft ${kafka.version} + + org.apache.kafka + kafka-server + ${kafka.version} + org.apache.kafka kafka-server-common @@ -1488,367 +1493,367 @@ org.springframework.boot spring-boot - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-test - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-test-autoconfigure - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-testcontainers - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-actuator - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-actuator-autoconfigure - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-autoconfigure - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-autoconfigure-processor - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-buildpack-platform - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-configuration-metadata - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-configuration-processor - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-devtools - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-docker-compose - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-jarmode-tools - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-loader - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-loader-classic - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-loader-tools - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-properties-migrator - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-activemq - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-actuator - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-amqp - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-aop - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-artemis - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-batch - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-cache - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-cassandra - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-cassandra-reactive - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-couchbase - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-couchbase-reactive - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-elasticsearch - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-jdbc - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-jpa - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-ldap - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-mongodb - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-mongodb-reactive - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-r2dbc - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-redis - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-redis-reactive - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-neo4j - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-data-rest - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-freemarker - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-graphql - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-groovy-templates - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-hateoas - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-integration - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-jdbc - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-jersey - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-jetty - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-jooq - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-json - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-log4j2 - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-logging - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-mail - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-mustache - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-oauth2-authorization-server - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-oauth2-client - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-oauth2-resource-server - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-pulsar - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-pulsar-reactive - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-quartz - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-reactor-netty - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-rsocket - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-security - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-test - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-thymeleaf - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-tomcat - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-undertow - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-validation - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-web - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-webflux - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-websocket - 3.4.0 + 3.4.1 org.springframework.boot spring-boot-starter-web-services - 3.4.0 + 3.4.1 com.sun.xml.messaging.saaj @@ -2557,7 +2562,7 @@ org.springframework.boot spring-boot-maven-plugin - 3.4.0 + 3.4.1 org.codehaus.mojo From ad6339146fbfccbcd09bac23bbf16e15db9710cf Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 19 Dec 2024 11:58:59 -0300 Subject: [PATCH 2/6] Revert "spring-boot: try to fix native support" This reverts commit e74f59a1dd04dd23cc1e4c0e76457b549b6a68a2. --- .../main/java/_package_/config/LoggingConfiguration.java.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/spring-boot/templates/src/main/java/_package_/config/LoggingConfiguration.java.ejs b/generators/spring-boot/templates/src/main/java/_package_/config/LoggingConfiguration.java.ejs index 20fbee6a3755..5cc16c09bba9 100644 --- a/generators/spring-boot/templates/src/main/java/_package_/config/LoggingConfiguration.java.ejs +++ b/generators/spring-boot/templates/src/main/java/_package_/config/LoggingConfiguration.java.ejs @@ -46,7 +46,7 @@ import static tech.jhipster.config.logging.LoggingUtils.*; /* * Configures the console and Logstash log appenders from the app properties */ -@Configuration(proxyBeanMethods = false) +@Configuration <%_ if (serviceDiscoveryAny) { _%> @RefreshScope <%_ } _%> From 0fa8c39b7f1c88a08815b1c534d35f7db15baeb6 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 19 Dec 2024 12:00:23 -0300 Subject: [PATCH 3/6] Revert "spring-boot: workaround issue" This reverts commit 46cc11204bf3f6f0625db06e7c57380de19d4669. --- generators/spring-boot/generator.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/generators/spring-boot/generator.ts b/generators/spring-boot/generator.ts index f7602a8c302b..b253b0a54088 100644 --- a/generators/spring-boot/generator.ts +++ b/generators/spring-boot/generator.ts @@ -612,10 +612,7 @@ public void set${javaBeanCase(propertyName)}(${propertyType} ${propertyName}) { const { graalvmSupport, reactive } = application; if (graalvmSupport && !reactive) { // Workaround https://github.com/spring-projects/spring-boot/issues/43260 - source.addJavaDependencies?.([ - { groupId: 'io.reactivex.rxjava3', artifactId: 'rxjava', scope: 'runtime' }, - { groupId: 'io.projectreactor', artifactId: 'reactor-core', scope: 'runtime' }, - ]); + source.addJavaDependencies?.([{ groupId: 'io.reactivex.rxjava3', artifactId: 'rxjava', scope: 'runtime' }]); } }, }); From 748ffb50f9a64efed8f24a891a9b1c72d92205b6 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 19 Dec 2024 12:01:11 -0300 Subject: [PATCH 4/6] Revert "spring-boot: workaround spring-boot issue" This reverts commit 0ecc318412e712becd63e6950393fbee9350d821. --- generators/spring-boot/generator.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/generators/spring-boot/generator.ts b/generators/spring-boot/generator.ts index b253b0a54088..4ca2e71fce28 100644 --- a/generators/spring-boot/generator.ts +++ b/generators/spring-boot/generator.ts @@ -608,13 +608,6 @@ public void set${javaBeanCase(propertyName)}(${propertyType} ${propertyName}) { source.addMavenDependency!({ inProfile: 'docker-compose', ...dockerComposeArtifact, optional: true }); } }, - nativeSupport({ application, source }) { - const { graalvmSupport, reactive } = application; - if (graalvmSupport && !reactive) { - // Workaround https://github.com/spring-projects/spring-boot/issues/43260 - source.addJavaDependencies?.([{ groupId: 'io.reactivex.rxjava3', artifactId: 'rxjava', scope: 'runtime' }]); - } - }, }); } From f7bb0ebb4882796633e5b403e150b8fa6180a2ad Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 19 Dec 2024 12:02:29 -0300 Subject: [PATCH 5/6] spring-boot: migrate to MockitoBean --- .../java/generators/graalvm/generator.ts | 36 +------------------ .../jwt/JwtAuthenticationTestUtils.java.ejs | 11 +++--- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/generators/java/generators/graalvm/generator.ts b/generators/java/generators/graalvm/generator.ts index 082bfa5e3d09..249f88258328 100644 --- a/generators/java/generators/graalvm/generator.ts +++ b/generators/java/generators/graalvm/generator.ts @@ -16,12 +16,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { extname } from 'path'; -import { isFileStateDeleted, isFileStateModified } from 'mem-fs-editor/state'; -import { passthrough } from '@yeoman/transform'; import BaseApplicationGenerator from '../../../base-application/index.js'; import { createNeedleCallback } from '../../../base/support/needles.js'; -import { addJavaAnnotation, addJavaImport } from '../../../java/support/add-java-annotation.js'; +import { addJavaImport } from '../../../java/support/add-java-annotation.js'; import { javaMainPackageTemplatesBlock } from '../../../java/support/files.js'; import { mavenDefinition } from './internal/maven-definition.js'; import { GRAALVM_REACHABILITY_METADATA } from './internal/constants.js'; @@ -118,37 +115,6 @@ export default class GraalvmGenerator extends BaseApplicationGenerator { return this.delegateTasksToBlueprint(() => this.preparing); } - get default() { - return this.asDefaultTaskGroup({ - // workaround for https://github.com/spring-projects/spring-boot/issues/32195 - async disabledInAotModeAnnotation({ application }) { - this.queueTransformStream( - { - name: 'adding @DisabledInAotMode annotations', - filter: file => - !isFileStateDeleted(file) && - isFileStateModified(file) && - file.path.startsWith(this.destinationPath(application.srcTestJava!)) && - extname(file.path) === '.java', - refresh: false, - }, - passthrough(file => { - const contents = file.contents.toString('utf8'); - if (/@(MockBean|SpyBean)/.test(contents) || (application.reactive && /@AuthenticationIntegrationTest/.test(contents))) { - file.contents = Buffer.from( - addJavaAnnotation(contents, { package: 'org.springframework.test.context.aot', annotation: 'DisabledInAotMode' }), - ); - } - }), - ); - }, - }); - } - - get [BaseApplicationGenerator.DEFAULT]() { - return this.delegateTasksToBlueprint(() => this.default); - } - get writing() { return this.asWritingTaskGroup({ async writingTemplateTask({ application }) { diff --git a/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs b/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs index 4766b5573508..dcde854ceb8c 100644 --- a/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs +++ b/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs @@ -26,7 +26,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import <%= packageName %>.repository.UserRepository; <%_ } _%> <%_ if (reactive) { _%> -import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.security.core.userdetails.ReactiveUserDetailsService; <%_ } _%> @@ -54,14 +54,13 @@ public class JwtAuthenticationTestUtils { } <%_ if (reactive) { _%> - // TODO switch to MockitoSpyBean https://github.com/spring-projects/spring-framework/issues/33941 - @MockBean + @MockitoBean private ReactiveUserDetailsService userDetailsService; -<%_ } _%> -<%_ if (reactive && generateBuiltInUserEntity) { _%> + <%_ if (generateBuiltInUserEntity) { _%> - @MockBean + @MockitoBean private UserRepository userRepository; + <%_ } _%> <%_ } _%> public static String createValidToken(String jwtKey) { From 91c208c3e5a85156eb1ee663ba3c1ef897918aaa Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 19 Dec 2024 13:26:57 -0300 Subject: [PATCH 6/6] Revert "spring-boot: migrate to MockitoBean" This reverts commit f7bb0ebb4882796633e5b403e150b8fa6180a2ad. --- .../java/generators/graalvm/generator.ts | 36 ++++++++++++++++++- .../jwt/JwtAuthenticationTestUtils.java.ejs | 11 +++--- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/generators/java/generators/graalvm/generator.ts b/generators/java/generators/graalvm/generator.ts index 249f88258328..082bfa5e3d09 100644 --- a/generators/java/generators/graalvm/generator.ts +++ b/generators/java/generators/graalvm/generator.ts @@ -16,9 +16,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { extname } from 'path'; +import { isFileStateDeleted, isFileStateModified } from 'mem-fs-editor/state'; +import { passthrough } from '@yeoman/transform'; import BaseApplicationGenerator from '../../../base-application/index.js'; import { createNeedleCallback } from '../../../base/support/needles.js'; -import { addJavaImport } from '../../../java/support/add-java-annotation.js'; +import { addJavaAnnotation, addJavaImport } from '../../../java/support/add-java-annotation.js'; import { javaMainPackageTemplatesBlock } from '../../../java/support/files.js'; import { mavenDefinition } from './internal/maven-definition.js'; import { GRAALVM_REACHABILITY_METADATA } from './internal/constants.js'; @@ -115,6 +118,37 @@ export default class GraalvmGenerator extends BaseApplicationGenerator { return this.delegateTasksToBlueprint(() => this.preparing); } + get default() { + return this.asDefaultTaskGroup({ + // workaround for https://github.com/spring-projects/spring-boot/issues/32195 + async disabledInAotModeAnnotation({ application }) { + this.queueTransformStream( + { + name: 'adding @DisabledInAotMode annotations', + filter: file => + !isFileStateDeleted(file) && + isFileStateModified(file) && + file.path.startsWith(this.destinationPath(application.srcTestJava!)) && + extname(file.path) === '.java', + refresh: false, + }, + passthrough(file => { + const contents = file.contents.toString('utf8'); + if (/@(MockBean|SpyBean)/.test(contents) || (application.reactive && /@AuthenticationIntegrationTest/.test(contents))) { + file.contents = Buffer.from( + addJavaAnnotation(contents, { package: 'org.springframework.test.context.aot', annotation: 'DisabledInAotMode' }), + ); + } + }), + ); + }, + }); + } + + get [BaseApplicationGenerator.DEFAULT]() { + return this.delegateTasksToBlueprint(() => this.default); + } + get writing() { return this.asWritingTaskGroup({ async writingTemplateTask({ application }) { diff --git a/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs b/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs index dcde854ceb8c..4766b5573508 100644 --- a/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs +++ b/generators/spring-boot/templates/src/test/java/_package_/security/jwt/JwtAuthenticationTestUtils.java.ejs @@ -26,7 +26,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import <%= packageName %>.repository.UserRepository; <%_ } _%> <%_ if (reactive) { _%> -import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.security.core.userdetails.ReactiveUserDetailsService; <%_ } _%> @@ -54,13 +54,14 @@ public class JwtAuthenticationTestUtils { } <%_ if (reactive) { _%> - @MockitoBean + // TODO switch to MockitoSpyBean https://github.com/spring-projects/spring-framework/issues/33941 + @MockBean private ReactiveUserDetailsService userDetailsService; - <%_ if (generateBuiltInUserEntity) { _%> +<%_ } _%> +<%_ if (reactive && generateBuiltInUserEntity) { _%> - @MockitoBean + @MockBean private UserRepository userRepository; - <%_ } _%> <%_ } _%> public static String createValidToken(String jwtKey) {