提交 5d57c95e 作者: 方治民

chore: upgrade deps (SpringBoot v4.0.1) in progress ...

上级 753f8008
# public/* linguist-vendored # public/* linguist-vendored
/gradlew text eol=lf
*.bat text eol=crlf *.bat text eol=crlf
*.jar binary *.jar binary
* text=auto eol=lf * text=auto eol=lf
...@@ -2,8 +2,9 @@ plugins { ...@@ -2,8 +2,9 @@ plugins {
id 'java' id 'java'
id 'java-library' id 'java-library'
// https://start.spring.io // https://start.spring.io
id 'org.springframework.boot' version '3.5.9' id 'org.springframework.boot' version '4.0.1'
id 'org.graalvm.buildtools.native' version '0.10.6' id 'org.graalvm.buildtools.native' version '0.11.3'
id 'org.hibernate.orm' version '7.2.0.Final'
// https://plugins.gradle.org/plugin/io.spring.dependency-management // https://plugins.gradle.org/plugin/io.spring.dependency-management
id 'io.spring.dependency-management' version '1.1.7' id 'io.spring.dependency-management' version '1.1.7'
// https://plugins.gradle.org/plugin/com.diffplug.spotless // https://plugins.gradle.org/plugin/com.diffplug.spotless
...@@ -25,7 +26,7 @@ ext { ...@@ -25,7 +26,7 @@ ext {
// SpringCloud // SpringCloud
// https://start.spring.io/ // https://start.spring.io/
springCloudVersion = '2025.0.1' springCloudVersion = '2025.1.0'
// SpringBootAdmin // SpringBootAdmin
// https://central.sonatype.com/artifact/de.codecentric/spring-boot-admin-starter-server // https://central.sonatype.com/artifact/de.codecentric/spring-boot-admin-starter-server
...@@ -47,13 +48,15 @@ ext { ...@@ -47,13 +48,15 @@ ext {
// https://central.sonatype.com/artifact/com.alibaba.fastjson2/fastjson2 // https://central.sonatype.com/artifact/com.alibaba.fastjson2/fastjson2
fastJsonVersion = '2.0.60' fastJsonVersion = '2.0.60'
// https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core // https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion = '3.2.0' xxlJobVersion = '3.3.1'
// https://central.sonatype.com/artifact/io.minio/minio // https://central.sonatype.com/artifact/io.minio/minio
minioVersion = '8.6.0' minioVersion = '8.6.0'
// https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-63 // https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-71
hibernateTypesVersion = '3.14.1' hibernateTypesVersion = '3.14.1'
// https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial // https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial
hibernateSpatialVersion = '7.2.0.Final' hibernateSpatialVersion = '7.2.0.Final'
// https://central.sonatype.com/artifact/app.tozzi/jpa-search-helper
jpaSearchHelperVersion = '3.6.2'
// https://central.sonatype.com/artifact/org.locationtech.jts/jts-core // https://central.sonatype.com/artifact/org.locationtech.jts/jts-core
jtsVersion = '1.20.0' jtsVersion = '1.20.0'
// https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts // https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts
...@@ -67,7 +70,7 @@ ext { ...@@ -67,7 +70,7 @@ ext {
// https://central.sonatype.com/artifact/org.lionsoul/ip2region // https://central.sonatype.com/artifact/org.lionsoul/ip2region
ip2regionVersion = '3.3.2' ip2regionVersion = '3.3.2'
// https://central.sonatype.com/artifact/com.github.piomin/loki-logging-spring-boot-starter // https://central.sonatype.com/artifact/com.github.piomin/loki-logging-spring-boot-starter
lokiLoggingVersion = '2.0.3' lokiLoggingVersion = '2.2.1'
// https://central.sonatype.com/artifact/com.github.ulisesbocchio/jasypt-spring-boot-starter // https://central.sonatype.com/artifact/com.github.ulisesbocchio/jasypt-spring-boot-starter
jasyptVersion = '4.0.3' jasyptVersion = '4.0.3'
// https://central.sonatype.com/artifact/net.bramp.ffmpeg/ffmpeg // https://central.sonatype.com/artifact/net.bramp.ffmpeg/ffmpeg
...@@ -77,7 +80,7 @@ ext { ...@@ -77,7 +80,7 @@ ext {
java { java {
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(17) languageVersion = JavaLanguageVersion.of(21)
} }
} }
...@@ -106,9 +109,10 @@ subprojects { ...@@ -106,9 +109,10 @@ subprojects {
} }
dependencies { dependencies {
implementation 'org.springframework.boot:spring-boot-starter' implementation 'org.springframework.cloud:spring-cloud-starter-config'
testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
compileOnly 'org.projectlombok:lombok' compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
...@@ -122,6 +126,12 @@ subprojects { ...@@ -122,6 +126,12 @@ subprojects {
} }
} }
hibernate {
enhancement {
enableAssociationManagement = true
}
}
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8' [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile).tap { tasks.withType(JavaCompile).tap {
......
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://mirrors.aliyun.com/gradle/distributions/v8.14.3/gradle-8.14.3-bin.zip distributionUrl=https\://mirrors.aliyun.com/gradle/distributions/v9.2.1/gradle-9.2.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
......
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015-2021 the original authors. # Copyright © 2015 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -86,8 +86,7 @@ done ...@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
...@@ -115,7 +114,6 @@ case "$( uname )" in #( ...@@ -115,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;; NONSTOP* ) nonstop=true ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
...@@ -173,7 +171,6 @@ fi ...@@ -173,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" ) JAVACMD=$( cygpath --unix "$JAVACMD" )
...@@ -206,15 +203,14 @@ fi ...@@ -206,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command: # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped. # and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.
......
...@@ -70,11 +70,10 @@ goto fail ...@@ -70,11 +70,10 @@ goto fail
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
......
...@@ -4,8 +4,8 @@ dependencies { ...@@ -4,8 +4,8 @@ dependencies {
implementation project(":modules:common:redis") implementation project(":modules:common:redis")
implementation project(":modules:common:doc") implementation project(":modules:common:doc")
implementation 'org.springframework.boot:spring-boot-starter-aop' implementation 'org.springframework.boot:spring-boot-starter-aspectj'
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-redis' implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-validation'
...@@ -18,8 +18,8 @@ dependencies { ...@@ -18,8 +18,8 @@ dependencies {
implementation "com.alibaba.fastjson2:fastjson2:${fastJsonVersion}" implementation "com.alibaba.fastjson2:fastjson2:${fastJsonVersion}"
// https://github.com/vladmihalcea/hypersistence-utils // https://github.com/vladmihalcea/hypersistence-utils
// hypersistence-utils-hibernate-63 // hypersistence-utils-hibernate-71
implementation "io.hypersistence:hypersistence-utils-hibernate-63:${hibernateTypesVersion}" implementation "io.hypersistence:hypersistence-utils-hibernate-71:${hibernateTypesVersion}"
// JTS 几何对象操作库 // JTS 几何对象操作库
implementation "org.locationtech.jts:jts-core:${jtsVersion}" implementation "org.locationtech.jts:jts-core:${jtsVersion}"
......
...@@ -22,6 +22,6 @@ public class CacheRequestContentFilter extends OncePerRequestFilter { ...@@ -22,6 +22,6 @@ public class CacheRequestContentFilter extends OncePerRequestFilter {
@NotNull HttpServletResponse response, @NotNull HttpServletResponse response,
FilterChain chain FilterChain chain
) throws ServletException, IOException { ) throws ServletException, IOException {
chain.doFilter(new ContentCachingRequestWrapper(request), response); chain.doFilter(new ContentCachingRequestWrapper(request, -1), response);
} }
} }
...@@ -16,7 +16,6 @@ import org.hibernate.generator.BeforeExecutionGenerator; ...@@ -16,7 +16,6 @@ import org.hibernate.generator.BeforeExecutionGenerator;
import org.hibernate.generator.EventType; import org.hibernate.generator.EventType;
import org.hibernate.generator.EventTypeSets; import org.hibernate.generator.EventTypeSets;
import org.hibernate.generator.GeneratorCreationContext; import org.hibernate.generator.GeneratorCreationContext;
import org.hibernate.id.factory.spi.CustomIdGeneratorCreationContext;
/** /**
* @author Jim * @author Jim
...@@ -44,14 +43,6 @@ public class SnowflakeIdGeneratorAccomplish implements BeforeExecutionGenerator ...@@ -44,14 +43,6 @@ public class SnowflakeIdGeneratorAccomplish implements BeforeExecutionGenerator
public SnowflakeIdGeneratorAccomplish( public SnowflakeIdGeneratorAccomplish(
SnowflakeIdGenerator config, SnowflakeIdGenerator config,
Member idMember,
CustomIdGeneratorCreationContext creationContext
) {
this(config, idMember);
}
public SnowflakeIdGeneratorAccomplish(
SnowflakeIdGenerator config,
Member member, Member member,
GeneratorCreationContext creationContext GeneratorCreationContext creationContext
) { ) {
......
...@@ -5,7 +5,8 @@ plugins { ...@@ -5,7 +5,8 @@ plugins {
dependencies { dependencies {
implementation project(":modules:common:core") implementation project(":modules:common:core")
implementation project(":modules:common:i18n") implementation project(":modules:common:i18n")
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-aspectj'
// xxl-job // xxl-job
api "com.xuxueli:xxl-job-core:${xxlJobVersion}" api "com.xuxueli:xxl-job-core:${xxlJobVersion}"
......
...@@ -7,7 +7,7 @@ dependencies { ...@@ -7,7 +7,7 @@ dependencies {
implementation project(":modules:common:util") implementation project(":modules:common:util")
implementation project(":modules:common:doc") implementation project(":modules:common:doc")
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-validation'
// minio // minio
......
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.common.config; package com.yiring.common.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.time.Duration; import java.time.Duration;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
...@@ -11,9 +10,10 @@ import org.springframework.data.redis.cache.RedisCacheConfiguration; ...@@ -11,9 +10,10 @@ import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.GenericJacksonJsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext; import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer;
import tools.jackson.databind.ObjectMapper;
/** /**
* Redis Config * Redis Config
...@@ -36,7 +36,7 @@ public class RedisConfig { ...@@ -36,7 +36,7 @@ public class RedisConfig {
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer(); StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
redisTemplate.setKeySerializer(stringRedisSerializer); redisTemplate.setKeySerializer(stringRedisSerializer);
redisTemplate.setHashKeySerializer(stringRedisSerializer); redisTemplate.setHashKeySerializer(stringRedisSerializer);
redisTemplate.setDefaultSerializer(new GenericJackson2JsonRedisSerializer(objectMapper)); redisTemplate.setDefaultSerializer(new GenericJacksonJsonRedisSerializer(objectMapper));
redisTemplate.setEnableTransactionSupport(false); redisTemplate.setEnableTransactionSupport(false);
redisTemplate.setConnectionFactory(factory); redisTemplate.setConnectionFactory(factory);
redisTemplate.afterPropertiesSet(); redisTemplate.afterPropertiesSet();
...@@ -50,7 +50,9 @@ public class RedisConfig { ...@@ -50,7 +50,9 @@ public class RedisConfig {
.entryTtl(Duration.ofMinutes(5)) .entryTtl(Duration.ofMinutes(5))
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer())) .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
.serializeValuesWith( .serializeValuesWith(
RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()) RedisSerializationContext.SerializationPair.fromSerializer(
new GenericJacksonJsonRedisSerializer(objectMapper)
)
) )
.disableCachingNullValues(); .disableCachingNullValues();
......
...@@ -3,8 +3,8 @@ plugins { ...@@ -3,8 +3,8 @@ plugins {
} }
dependencies { dependencies {
implementation 'org.springframework.boot:spring-boot-starter-aop' implementation 'org.springframework.boot:spring-boot-starter-aspectj'
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-validation'
// Spring Retry // Spring Retry
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
package com.yiring.common.jackson; package com.yiring.common.jackson;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.lang.annotation.*; import java.lang.annotation.*;
import tools.jackson.databind.annotation.JsonSerialize;
/** /**
* Jackson Mapping 序列化 * Jackson Mapping 序列化
......
/* (C) 2021 YiRing, Inc. */ /* (C) 2021 YiRing, Inc. */
package com.yiring.common.jackson; package com.yiring.common.jackson;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import tools.jackson.core.JacksonException;
import tools.jackson.core.JsonGenerator;
import tools.jackson.databind.BeanProperty;
import tools.jackson.databind.SerializationContext;
import tools.jackson.databind.ValueSerializer;
import tools.jackson.databind.ser.std.StdSerializer;
/** /**
* Mapping 序列化 * Mapping 序列化
...@@ -20,7 +20,7 @@ import java.util.Objects; ...@@ -20,7 +20,7 @@ import java.util.Objects;
* @version 0.1 * @version 0.1
* 2021/10/15 18:11 * 2021/10/15 18:11
*/ */
public class ObjectMappingSerializer extends StdSerializer<Object> implements ContextualSerializer { public class ObjectMappingSerializer extends StdSerializer<Object> implements Serializable {
@Serial @Serial
private static final long serialVersionUID = -1924851196524453827L; private static final long serialVersionUID = -1924851196524453827L;
...@@ -36,7 +36,7 @@ public class ObjectMappingSerializer extends StdSerializer<Object> implements Co ...@@ -36,7 +36,7 @@ public class ObjectMappingSerializer extends StdSerializer<Object> implements Co
} }
@Override @Override
public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property) { public ValueSerializer<?> createContextual(SerializationContext ctx, BeanProperty property) {
MappingSerialize mappingSerialize = property.getAnnotation(MappingSerialize.class); MappingSerialize mappingSerialize = property.getAnnotation(MappingSerialize.class);
String mapping = mappingSerialize.mapping(); String mapping = mappingSerialize.mapping();
...@@ -55,10 +55,10 @@ public class ObjectMappingSerializer extends StdSerializer<Object> implements Co ...@@ -55,10 +55,10 @@ public class ObjectMappingSerializer extends StdSerializer<Object> implements Co
} }
@Override @Override
public void serialize(Object value, JsonGenerator gen, SerializerProvider provider) throws IOException { public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException {
String text = mapping.get(Objects.toString(value)); String text = mapping.get(Objects.toString(value));
if (text == null || text.isEmpty()) { if (text == null || text.isEmpty()) {
gen.writeObject(value); gen.writeObjectRef(value);
} else { } else {
gen.writeString(text); gen.writeString(text);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论