提交 5d57c95e 作者: 方治民

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

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