diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..3b41682ac --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..740efb2e4 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,10 @@ +wrapperVersion=3.3.4 +distributionType=only-script +# Maven 3.9.X +distributionUrl=https://mirrors.huaweicloud.com/apache/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.zip +# Maven 4.0 +#distributionUrl=https://mirrors.huaweicloud.com/apache/maven/maven-4/4.0.0-rc-5/binaries/apache-maven-4.0.0-rc-5-bin.zip +# Maven Daemon (mvnd) +#distributionUrl=https://mirrors.huaweicloud.com/apache/maven/mvnd/1.0.2/maven-mvnd-1.0.2-bin.zip +# 分发类型为 only-script 或 bin 可以不需要该项(因为用不到),具体参考:https://maven.apache.org/tools/wrapper/maven-wrapper-distribution/index.html +#wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar diff --git a/mvnw b/mvnw new file mode 100644 index 000000000..bd8896bf2 --- /dev/null +++ b/mvnw @@ -0,0 +1,295 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.4 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +scriptDir="$(dirname "$0")" +scriptName="$(basename "$0")" + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +actualDistributionDir="" + +# First try the expected directory name (for regular distributions) +if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then + if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then + actualDistributionDir="$distributionUrlNameMain" + fi +fi + +# If not found, search for any directory with the Maven executable (for snapshots) +if [ -z "$actualDistributionDir" ]; then + # enable globbing to iterate over items + set +f + for dir in "$TMP_DOWNLOAD_DIR"/*; do + if [ -d "$dir" ]; then + if [ -f "$dir/bin/$MVN_CMD" ]; then + actualDistributionDir="$(basename "$dir")" + break + fi + fi + done + set -f +fi + +if [ -z "$actualDistributionDir" ]; then + verbose "Contents of $TMP_DOWNLOAD_DIR:" + verbose "$(ls -la "$TMP_DOWNLOAD_DIR")" + die "Could not find Maven distribution directory in extracted archive" +fi + +verbose "Found extracted Maven distribution directory: $actualDistributionDir" +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 000000000..8e9ed5ea6 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,191 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.4 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' + +$MAVEN_M2_PATH = "$HOME/.m2" +if ($env:MAVEN_USER_HOME) { + $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME" +} + +if (-not (Test-Path -Path $MAVEN_M2_PATH)) { + New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null +} + +$MAVEN_WRAPPER_DISTS = $null +$mavenM2Item = Get-Item $MAVEN_M2_PATH +$mavenM2Target = @($mavenM2Item.Target) +if ($mavenM2Target.Count -gt 0 -and $null -ne $mavenM2Target[0]) { + $MAVEN_WRAPPER_DISTS = $mavenM2Target[0] + "/wrapper/dists" +} else { + $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists" +} + +$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +$actualDistributionDir = "" + +# First try the expected directory name (for regular distributions) +$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain" +$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD" +if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) { + $actualDistributionDir = $distributionUrlNameMain +} + +# If not found, search for any directory with the Maven executable (for snapshots) +if (!$actualDistributionDir) { + Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object { + $testPath = Join-Path $_.FullName "bin/$MVN_CMD" + if (Test-Path -Path $testPath -PathType Leaf) { + $actualDistributionDir = $_.Name + } + } +} + +if (!$actualDistributionDir) { + Write-Error "Could not find Maven distribution directory in extracted archive" +} + +Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir" +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/pom.xml b/pom.xml index 5ec539136..a74a5d754 100644 --- a/pom.xml +++ b/pom.xml @@ -17,20 +17,20 @@ UTF-8 UTF-8 17 - 3.5.11 - 2025.0.1 - 3.5.6 + 4.0.3 + 2025.1.1 + 4.0.2 3.5.19 3.5.16 3.9.1 - 4.3.1 + 4.5.0 2.3 2.2.41 - 2.8.15 + 3.0.2 0.15.0 1.3.0 5.8.43 - 3.52.0 + 4.3.0 2.2.7 1.9.0 1.44.0 @@ -176,7 +176,7 @@ com.baomidou - mybatis-plus-spring-boot3-starter + mybatis-plus-spring-boot4-starter ${mybatis-plus.version} diff --git a/ruoyi-auth/src/main/java/org/dromara/auth/RuoYiAuthApplication.java b/ruoyi-auth/src/main/java/org/dromara/auth/RuoYiAuthApplication.java index 12d4d6306..4c78696ba 100644 --- a/ruoyi-auth/src/main/java/org/dromara/auth/RuoYiAuthApplication.java +++ b/ruoyi-auth/src/main/java/org/dromara/auth/RuoYiAuthApplication.java @@ -3,7 +3,6 @@ package org.dromara.auth; import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; /** @@ -12,7 +11,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt * @author ruoyi */ @EnableDubbo -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +@SpringBootApplication public class RuoYiAuthApplication { public static void main(String[] args) { SpringApplication application = new SpringApplication(RuoYiAuthApplication.class); diff --git a/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml b/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml index ec1f0bba6..3378ba6d2 100644 --- a/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml +++ b/ruoyi-common/ruoyi-common-alibaba-bom/pom.xml @@ -15,9 +15,9 @@ 2.5.3 - 2025.0.0.0 + 2025.1.0.0 2.5.0 - 2.5.1 + 3.1.1 3.3.6 3.3.1 diff --git a/ruoyi-common/ruoyi-common-core/pom.xml b/ruoyi-common/ruoyi-common-core/pom.xml index 01d876e77..5f8088ffb 100644 --- a/ruoyi-common/ruoyi-common-core/pom.xml +++ b/ruoyi-common/ruoyi-common-core/pom.xml @@ -36,7 +36,8 @@ org.springframework.boot - spring-boot-starter-aop + spring-boot-starter-aspectj + ${spring-boot.version} diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ValidatorConfig.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ValidatorConfig.java index ddcd836e4..3c8e60780 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ValidatorConfig.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/ValidatorConfig.java @@ -3,7 +3,7 @@ package org.dromara.common.core.config; import jakarta.validation.Validator; import org.hibernate.validator.HibernateValidator; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration; +import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/SpringUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/SpringUtils.java index 5ff751d15..016115316 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/SpringUtils.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/SpringUtils.java @@ -2,7 +2,7 @@ package org.dromara.common.core.utils; import cn.hutool.extra.spring.SpringUtil; import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.boot.autoconfigure.thread.Threading; +import org.springframework.boot.thread.Threading; import org.springframework.context.ApplicationContext; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; diff --git a/ruoyi-common/ruoyi-common-doc/pom.xml b/ruoyi-common/ruoyi-common-doc/pom.xml index 26a35fc80..e44512434 100644 --- a/ruoyi-common/ruoyi-common-doc/pom.xml +++ b/ruoyi-common/ruoyi-common-doc/pom.xml @@ -22,6 +22,11 @@ ruoyi-common-core + + org.springframework.boot + spring-boot-web-server + + org.springdoc springdoc-openapi-starter-webmvc-api diff --git a/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocAutoConfiguration.java b/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocAutoConfiguration.java index f9403c792..decef8f17 100644 --- a/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocAutoConfiguration.java +++ b/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocAutoConfiguration.java @@ -25,8 +25,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.context.annotation.Bean; import java.util.*; @@ -99,17 +99,20 @@ public class SpringDocAutoConfiguration { */ @Bean public OpenApiCustomizer openApiCustomizer() { + String contextPath = serverProperties.getServlet().getContextPath(); + String finalContextPath = StringUtils.isBlank(contextPath) || "/".equals(contextPath) ? "" : contextPath; // 对所有路径增加前置上下文路径 return openApi -> { HttpServletRequest request = ServletUtils.getRequest(); // 从请求头获取gateway转发的服务前缀 - String prefix = StringUtils.blankToDefault(request.getHeader("X-Forwarded-Prefix"), ""); + String prefix = request == null ? "" : StringUtils.blankToDefault(request.getHeader("X-Forwarded-Prefix"), ""); Paths oldPaths = openApi.getPaths(); if (oldPaths instanceof PlusPaths) { return; } PlusPaths newPaths = new PlusPaths(); - oldPaths.forEach((k, v) -> newPaths.addPathItem(prefix + k, v)); + String pathPrefix = StringUtils.isNotBlank(prefix) ? prefix : finalContextPath; + oldPaths.forEach((k, v) -> newPaths.addPathItem(pathPrefix + k, v)); openApi.setPaths(newPaths); }; } diff --git a/ruoyi-common/ruoyi-common-encrypt/pom.xml b/ruoyi-common/ruoyi-common-encrypt/pom.xml index ed4910ef0..0e82c1149 100644 --- a/ruoyi-common/ruoyi-common-encrypt/pom.xml +++ b/ruoyi-common/ruoyi-common-encrypt/pom.xml @@ -39,7 +39,7 @@ com.baomidou - mybatis-plus-spring-boot3-starter + mybatis-plus-spring-boot4-starter true diff --git a/ruoyi-common/ruoyi-common-json/pom.xml b/ruoyi-common/ruoyi-common-json/pom.xml index 870df5cdc..c6469b3d1 100644 --- a/ruoyi-common/ruoyi-common-json/pom.xml +++ b/ruoyi-common/ruoyi-common-json/pom.xml @@ -21,15 +21,9 @@ ruoyi-common-core - - com.fasterxml.jackson.core - jackson-databind - - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 + org.springframework.boot + spring-boot-starter-jackson diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/config/JacksonConfig.java b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/config/JacksonConfig.java index 039257387..a64653615 100644 --- a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/config/JacksonConfig.java +++ b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/config/JacksonConfig.java @@ -1,17 +1,16 @@ package org.dromara.common.json.config; -import com.fasterxml.jackson.databind.Module; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; -import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import lombok.extern.slf4j.Slf4j; import org.dromara.common.json.handler.BigNumberSerializer; import org.dromara.common.json.handler.CustomDateDeserializer; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; -import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; +import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; +import org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer; import org.springframework.context.annotation.Bean; +import tools.jackson.databind.ext.javatime.deser.LocalDateTimeDeserializer; +import tools.jackson.databind.ext.javatime.ser.LocalDateTimeSerializer; +import tools.jackson.databind.module.SimpleModule; +import tools.jackson.databind.ser.std.ToStringSerializer; import java.math.BigDecimal; import java.math.BigInteger; @@ -30,24 +29,24 @@ import java.util.TimeZone; public class JacksonConfig { @Bean - public Module registerJavaTimeModule() { + public SimpleModule registerJavaTimeModule() { // 全局配置序列化返回 JSON 处理 - JavaTimeModule javaTimeModule = new JavaTimeModule(); - javaTimeModule.addSerializer(Long.class, BigNumberSerializer.INSTANCE); - javaTimeModule.addSerializer(Long.TYPE, BigNumberSerializer.INSTANCE); - javaTimeModule.addSerializer(BigInteger.class, BigNumberSerializer.INSTANCE); - javaTimeModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); + SimpleModule module = new SimpleModule(); + module.addSerializer(Long.class, BigNumberSerializer.INSTANCE); + module.addSerializer(Long.TYPE, BigNumberSerializer.INSTANCE); + module.addSerializer(BigInteger.class, BigNumberSerializer.INSTANCE); + module.addSerializer(BigDecimal.class, ToStringSerializer.instance); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter)); - javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter)); - javaTimeModule.addDeserializer(Date.class, new CustomDateDeserializer()); - return javaTimeModule; + module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter)); + module.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter)); + module.addDeserializer(Date.class, new CustomDateDeserializer()); + return module; } @Bean - public Jackson2ObjectMapperBuilderCustomizer customizer() { + public JsonMapperBuilderCustomizer jsonInitCustomizer() { return builder -> { - builder.timeZone(TimeZone.getDefault()); + builder.defaultTimeZone(TimeZone.getDefault()); log.info("初始化 jackson 配置"); }; } diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/BigNumberSerializer.java b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/BigNumberSerializer.java index f2a7c2d8c..e13795a25 100644 --- a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/BigNumberSerializer.java +++ b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/BigNumberSerializer.java @@ -1,11 +1,9 @@ package org.dromara.common.json.handler; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JacksonStdImpl; -import com.fasterxml.jackson.databind.ser.std.NumberSerializer; - -import java.io.IOException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.databind.SerializationContext; +import tools.jackson.databind.annotation.JacksonStdImpl; +import tools.jackson.databind.ser.jdk.NumberSerializer; /** * 超出 JS 最大最小值 处理 @@ -31,8 +29,8 @@ public class BigNumberSerializer extends NumberSerializer { } @Override - public void serialize(Number value, JsonGenerator gen, SerializerProvider provider) throws IOException { - // 超出范围 序列化位字符串 + public void serialize(Number value, JsonGenerator gen, SerializationContext provider) { + // 超出范围 序列化为字符串 if (value.longValue() > MIN_SAFE_INTEGER && value.longValue() < MAX_SAFE_INTEGER) { super.serialize(value, gen, provider); } else { diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/CustomDateDeserializer.java b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/CustomDateDeserializer.java index 21c6a6aa6..9a7d96bd2 100644 --- a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/CustomDateDeserializer.java +++ b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/handler/CustomDateDeserializer.java @@ -2,12 +2,11 @@ package org.dromara.common.json.handler; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; import org.dromara.common.core.utils.ObjectUtils; +import tools.jackson.core.JsonParser; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.ValueDeserializer; -import java.io.IOException; import java.util.Date; /** @@ -15,7 +14,7 @@ import java.util.Date; * * @author AprilWind */ -public class CustomDateDeserializer extends JsonDeserializer { +public class CustomDateDeserializer extends ValueDeserializer { /** * 反序列化逻辑:将字符串转换为 Date 对象 @@ -23,10 +22,9 @@ public class CustomDateDeserializer extends JsonDeserializer { * @param p JSON 解析器,用于获取字符串值 * @param ctxt 上下文环境(可用于获取更多配置) * @return 转换后的 Date 对象,若为空字符串返回 null - * @throws IOException 当字符串格式非法或转换失败时抛出 */ @Override - public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public Date deserialize(JsonParser p, DeserializationContext ctxt) { DateTime parse = DateUtil.parse(p.getText()); if (ObjectUtils.isNull(parse)) { return null; diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java index c0b60a450..b0cfe8f3a 100644 --- a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java +++ b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java @@ -3,17 +3,14 @@ package org.dromara.common.json.utils; import cn.hutool.core.lang.Dict; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.exc.MismatchedInputException; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.dromara.common.core.utils.SpringUtils; import org.dromara.common.core.utils.StringUtils; +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.json.JsonMapper; -import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -25,10 +22,14 @@ import java.util.List; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class JsonUtils { - private static final ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class); + private static final JsonMapper JSON_MAPPER = SpringUtils.getBean(JsonMapper.class); - public static ObjectMapper getObjectMapper() { - return OBJECT_MAPPER; + public static JsonMapper getJsonMapper() { + return JSON_MAPPER; + } + + public static JsonMapper getObjectMapper() { + return JSON_MAPPER; } /** @@ -42,11 +43,7 @@ public class JsonUtils { if (ObjectUtil.isNull(object)) { return null; } - try { - return OBJECT_MAPPER.writeValueAsString(object); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } + return JSON_MAPPER.writeValueAsString(object); } /** @@ -62,11 +59,7 @@ public class JsonUtils { if (StringUtils.isEmpty(text)) { return null; } - try { - return OBJECT_MAPPER.readValue(text, clazz); - } catch (IOException e) { - throw new RuntimeException(e); - } + return JSON_MAPPER.readValue(text, clazz); } /** @@ -82,11 +75,7 @@ public class JsonUtils { if (ArrayUtil.isEmpty(bytes)) { return null; } - try { - return OBJECT_MAPPER.readValue(bytes, clazz); - } catch (IOException e) { - throw new RuntimeException(e); - } + return JSON_MAPPER.readValue(bytes, clazz); } /** @@ -102,11 +91,7 @@ public class JsonUtils { if (StringUtils.isBlank(text)) { return null; } - try { - return OBJECT_MAPPER.readValue(text, typeReference); - } catch (IOException e) { - throw new RuntimeException(e); - } + return JSON_MAPPER.readValue(text, typeReference); } /** @@ -120,14 +105,7 @@ public class JsonUtils { if (StringUtils.isBlank(text)) { return null; } - try { - return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructType(Dict.class)); - } catch (MismatchedInputException e) { - // 类型不匹配说明不是json - return null; - } catch (IOException e) { - throw new RuntimeException(e); - } + return JSON_MAPPER.readValue(text, JSON_MAPPER.getTypeFactory().constructType(Dict.class)); } /** @@ -141,11 +119,7 @@ public class JsonUtils { if (StringUtils.isBlank(text)) { return null; } - try { - return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, Dict.class)); - } catch (IOException e) { - throw new RuntimeException(e); - } + return JSON_MAPPER.readValue(text, JSON_MAPPER.getTypeFactory().constructCollectionType(List.class, Dict.class)); } /** @@ -161,11 +135,7 @@ public class JsonUtils { if (StringUtils.isEmpty(text)) { return new ArrayList<>(); } - try { - return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, clazz)); - } catch (IOException e) { - throw new RuntimeException(e); - } + return JSON_MAPPER.readValue(text, JSON_MAPPER.getTypeFactory().constructCollectionType(List.class, clazz)); } /** @@ -179,7 +149,7 @@ public class JsonUtils { return false; } try { - OBJECT_MAPPER.readTree(str); + JSON_MAPPER.readTree(str); return true; } catch (Exception e) { return false; @@ -197,7 +167,7 @@ public class JsonUtils { return false; } try { - JsonNode node = OBJECT_MAPPER.readTree(str); + JsonNode node = JSON_MAPPER.readTree(str); return node.isObject(); } catch (Exception e) { return false; @@ -215,7 +185,7 @@ public class JsonUtils { return false; } try { - JsonNode node = OBJECT_MAPPER.readTree(str); + JsonNode node = JSON_MAPPER.readTree(str); return node.isArray(); } catch (Exception e) { return false; diff --git a/ruoyi-common/ruoyi-common-mybatis/pom.xml b/ruoyi-common/ruoyi-common-mybatis/pom.xml index 77a88301a..984cb6483 100644 --- a/ruoyi-common/ruoyi-common-mybatis/pom.xml +++ b/ruoyi-common/ruoyi-common-mybatis/pom.xml @@ -29,7 +29,7 @@ com.baomidou - mybatis-plus-spring-boot3-starter + mybatis-plus-spring-boot4-starter @@ -46,7 +46,7 @@ com.baomidou - dynamic-datasource-spring-boot3-starter + dynamic-datasource-spring-boot4-starter ${dynamic-ds.version} diff --git a/ruoyi-common/ruoyi-common-redis/pom.xml b/ruoyi-common/ruoyi-common-redis/pom.xml index 576be5e14..12cb577f7 100644 --- a/ruoyi-common/ruoyi-common-redis/pom.xml +++ b/ruoyi-common/ruoyi-common-redis/pom.xml @@ -28,6 +28,12 @@ redisson-spring-boot-starter + + org.redisson + redisson-spring-cache + ${redisson.version} + + com.baomidou lock4j-redisson-spring-boot-starter diff --git a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/handler/KeyPrefixHandler.java b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/handler/KeyPrefixHandler.java index 3bf3e346a..f34ddc83a 100644 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/handler/KeyPrefixHandler.java +++ b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/handler/KeyPrefixHandler.java @@ -1,7 +1,7 @@ package org.dromara.common.redis.handler; import org.dromara.common.core.utils.StringUtils; -import org.redisson.api.NameMapper; +import org.redisson.config.NameMapper; /** * redis缓存key前缀处理 diff --git a/ruoyi-common/ruoyi-common-web/pom.xml b/ruoyi-common/ruoyi-common-web/pom.xml index 6bb300632..0c948382d 100644 --- a/ruoyi-common/ruoyi-common-web/pom.xml +++ b/ruoyi-common/ruoyi-common-web/pom.xml @@ -33,10 +33,11 @@ - + org.springframework.boot - spring-boot-starter-undertow + spring-boot-starter-jetty + ${spring-boot.version} diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/I18nConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/I18nConfig.java index 4e212cb73..317479aa7 100644 --- a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/I18nConfig.java +++ b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/I18nConfig.java @@ -2,7 +2,7 @@ package org.dromara.common.web.config; import org.dromara.common.web.core.I18nLocaleResolver; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; +import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.web.servlet.LocaleResolver; diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java index b201dfd10..961d177da 100644 --- a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java +++ b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/config/UndertowConfig.java @@ -1,75 +1,43 @@ -package org.dromara.common.web.config; - -import io.undertow.UndertowOptions; -import io.undertow.server.DefaultByteBufferPool; -import io.undertow.server.handlers.DisallowedMethodsHandler; -import io.undertow.util.HttpString; -import io.undertow.websockets.jsr.WebSocketDeploymentInfo; -import org.dromara.common.core.utils.SpringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.core.task.VirtualThreadTaskExecutor; - -/** - * Undertow 自定义配置 - * - * @author Lion Li - */ -@AutoConfiguration -public class UndertowConfig implements WebServerFactoryCustomizer { - - @Autowired - private ServerProperties serverProperties; - - /** - * 自定义 Undertow 配置 - *

- * 主要配置内容包括: - * 1. 配置 WebSocket 部署信息 - * 2. 在虚拟线程模式下使用虚拟线程池 - * 3. 禁用不安全的 HTTP 方法,如 CONNECT、TRACE、TRACK - *

- * - * @param factory Undertow 的 Web 服务器工厂 - */ - @Override - public void customize(UndertowServletWebServerFactory factory) { - long bytes = serverProperties.getUndertow().getMaxHttpPostSize().toBytes(); - factory.addBuilderCustomizers(builder -> { - builder.setServerOption(UndertowOptions.MULTIPART_MAX_ENTITY_SIZE, bytes); - }); - - // 默认不直接分配内存 如果项目中使用了 websocket 建议直接分配 - factory.addDeploymentInfoCustomizers(deploymentInfo -> { - // 配置 WebSocket 部署信息,设置 WebSocket 使用的缓冲区池 - WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); - webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(true, 1024)); - deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); - - // 如果启用了虚拟线程,配置 Undertow 使用虚拟线程池 - if (SpringUtils.isVirtual()) { - // 创建虚拟线程池,线程池前缀为 "undertow-" - VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-"); - // 设置虚拟线程池为执行器和异步执行器 - deploymentInfo.setExecutor(executor); - deploymentInfo.setAsyncExecutor(executor); - } - - // 配置禁止某些不安全的 HTTP 方法(如 CONNECT、TRACE、TRACK) - deploymentInfo.addInitialHandlerChainWrapper(handler -> { - // 禁止三个方法 CONNECT/TRACE/TRACK 也是不安全的 避免爬虫骚扰 - HttpString[] disallowedHttpMethods = { - HttpString.tryFromString("CONNECT"), - HttpString.tryFromString("TRACE"), - HttpString.tryFromString("TRACK") - }; - // 使用 DisallowedMethodsHandler 拦截并拒绝这些方法的请求 - return new DisallowedMethodsHandler(handler, disallowedHttpMethods); - }); - }); - } - -} +//package org.dromara.common.web.config; +// +//import io.undertow.server.DefaultByteBufferPool; +//import io.undertow.server.handlers.DisallowedMethodsHandler; +//import io.undertow.util.HttpString; +//import io.undertow.websockets.jsr.WebSocketDeploymentInfo; +//import org.dromara.common.core.utils.SpringUtils; +//import org.springframework.boot.autoconfigure.AutoConfiguration; +//import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +//import org.springframework.boot.web.server.WebServerFactoryCustomizer; +//import org.springframework.core.task.VirtualThreadTaskExecutor; +// +///** +// * Boot 4 迁移后默认改用 Jetty,这里暂时保留 Undertow 配置实现以便后续回切时参考。 +// */ +//@AutoConfiguration +//public class UndertowConfig implements WebServerFactoryCustomizer { +// +// @Override +// public void customize(UndertowServletWebServerFactory factory) { +// factory.addDeploymentInfoCustomizers(deploymentInfo -> { +// WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); +// webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(true, 1024)); +// deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); +// +// if (SpringUtils.isVirtual()) { +// VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-"); +// deploymentInfo.setExecutor(executor); +// deploymentInfo.setAsyncExecutor(executor); +// } +// +// deploymentInfo.addInitialHandlerChainWrapper(handler -> { +// HttpString[] disallowedHttpMethods = { +// HttpString.tryFromString("CONNECT"), +// HttpString.tryFromString("TRACE"), +// HttpString.tryFromString("TRACK") +// }; +// return new DisallowedMethodsHandler(handler, disallowedHttpMethods); +// }); +// }); +// } +// +//} diff --git a/ruoyi-gateway-mvc/pom.xml b/ruoyi-gateway-mvc/pom.xml index dc4522f60..31ae08bba 100644 --- a/ruoyi-gateway-mvc/pom.xml +++ b/ruoyi-gateway-mvc/pom.xml @@ -33,10 +33,11 @@
- + org.springframework.boot - spring-boot-starter-undertow + spring-boot-starter-jetty + ${spring-boot.version} @@ -76,6 +77,11 @@ ruoyi-common-satoken + + org.dromara + ruoyi-common-json + + org.dromara diff --git a/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/RuoYiGatewayMvcApplication.java b/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/RuoYiGatewayMvcApplication.java index afff415a4..4e988885f 100644 --- a/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/RuoYiGatewayMvcApplication.java +++ b/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/RuoYiGatewayMvcApplication.java @@ -2,7 +2,6 @@ package org.dromara.gateway; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; /** @@ -10,7 +9,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt * * @author Lion Li */ -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +@SpringBootApplication public class RuoYiGatewayMvcApplication { public static void main(String[] args) { diff --git a/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/config/UndertowConfig.java b/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/config/UndertowConfig.java index dd274b5c4..e9503b511 100644 --- a/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/config/UndertowConfig.java +++ b/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/config/UndertowConfig.java @@ -1,75 +1,43 @@ -package org.dromara.gateway.config; - -import io.undertow.UndertowOptions; -import io.undertow.server.DefaultByteBufferPool; -import io.undertow.server.handlers.DisallowedMethodsHandler; -import io.undertow.util.HttpString; -import io.undertow.websockets.jsr.WebSocketDeploymentInfo; -import org.dromara.common.core.utils.SpringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.task.VirtualThreadTaskExecutor; - -/** - * Undertow 自定义配置 - * - * @author Lion Li - */ -@Configuration -public class UndertowConfig implements WebServerFactoryCustomizer { - - @Autowired - private ServerProperties serverProperties; - - /** - * 自定义 Undertow 配置 - *

- * 主要配置内容包括: - * 1. 配置 WebSocket 部署信息 - * 2. 在虚拟线程模式下使用虚拟线程池 - * 3. 禁用不安全的 HTTP 方法,如 CONNECT、TRACE、TRACK - *

- * - * @param factory Undertow 的 Web 服务器工厂 - */ - @Override - public void customize(UndertowServletWebServerFactory factory) { - long bytes = serverProperties.getUndertow().getMaxHttpPostSize().toBytes(); - factory.addBuilderCustomizers(builder -> { - builder.setServerOption(UndertowOptions.MULTIPART_MAX_ENTITY_SIZE, bytes); - }); - - // 默认不直接分配内存 如果项目中使用了 websocket 建议直接分配 - factory.addDeploymentInfoCustomizers(deploymentInfo -> { - // 配置 WebSocket 部署信息,设置 WebSocket 使用的缓冲区池 - WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); - webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(true, 1024)); - deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); - - // 如果启用了虚拟线程,配置 Undertow 使用虚拟线程池 - if (SpringUtils.isVirtual()) { - // 创建虚拟线程池,线程池前缀为 "undertow-" - VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-"); - // 设置虚拟线程池为执行器和异步执行器 - deploymentInfo.setExecutor(executor); - deploymentInfo.setAsyncExecutor(executor); - } - - // 配置禁止某些不安全的 HTTP 方法(如 CONNECT、TRACE、TRACK) - deploymentInfo.addInitialHandlerChainWrapper(handler -> { - // 禁止三个方法 CONNECT/TRACE/TRACK 也是不安全的 避免爬虫骚扰 - HttpString[] disallowedHttpMethods = { - HttpString.tryFromString("CONNECT"), - HttpString.tryFromString("TRACE"), - HttpString.tryFromString("TRACK") - }; - // 使用 DisallowedMethodsHandler 拦截并拒绝这些方法的请求 - return new DisallowedMethodsHandler(handler, disallowedHttpMethods); - }); - }); - } - -} +//package org.dromara.gateway.config; +// +//import io.undertow.server.DefaultByteBufferPool; +//import io.undertow.server.handlers.DisallowedMethodsHandler; +//import io.undertow.util.HttpString; +//import io.undertow.websockets.jsr.WebSocketDeploymentInfo; +//import org.dromara.common.core.utils.SpringUtils; +//import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +//import org.springframework.boot.web.server.WebServerFactoryCustomizer; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.core.task.VirtualThreadTaskExecutor; +// +///** +// * Boot 4 迁移后默认改用 Jetty,这里暂时保留 Undertow 配置实现以便后续回切时参考。 +// */ +//@Configuration +//public class UndertowConfig implements WebServerFactoryCustomizer { +// +// @Override +// public void customize(UndertowServletWebServerFactory factory) { +// factory.addDeploymentInfoCustomizers(deploymentInfo -> { +// WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); +// webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(true, 1024)); +// deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); +// +// if (SpringUtils.isVirtual()) { +// VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-"); +// deploymentInfo.setExecutor(executor); +// deploymentInfo.setAsyncExecutor(executor); +// } +// +// deploymentInfo.addInitialHandlerChainWrapper(handler -> { +// HttpString[] disallowedHttpMethods = { +// HttpString.tryFromString("CONNECT"), +// HttpString.tryFromString("TRACE"), +// HttpString.tryFromString("TRACK") +// }; +// return new DisallowedMethodsHandler(handler, disallowedHttpMethods); +// }); +// }); +// } +// +//} diff --git a/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java b/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java index 033050afb..af4a01063 100644 --- a/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java +++ b/ruoyi-gateway-mvc/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java @@ -3,10 +3,6 @@ package org.dromara.gateway.filter; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; @@ -26,6 +22,10 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.filter.OncePerRequestFilter; import org.springframework.web.util.UriComponentsBuilder; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.json.JsonMapper; +import tools.jackson.databind.node.ArrayNode; +import tools.jackson.databind.node.ObjectNode; import java.io.IOException; import java.util.HashSet; @@ -116,8 +116,8 @@ public class GlobalLogFilter extends OncePerRequestFilter { private String removeSensitiveFields(String jsonParam) { try { - ObjectMapper objectMapper = JsonUtils.getObjectMapper(); - JsonNode rootNode = objectMapper.readTree(jsonParam); + JsonMapper jsonMapper = JsonUtils.getJsonMapper(); + JsonNode rootNode = jsonMapper.readTree(jsonParam); removeSensitiveFields(rootNode, SystemConstants.EXCLUDE_PROPERTIES); return rootNode.toString(); } catch (Exception ex) { @@ -132,13 +132,13 @@ public class GlobalLogFilter extends OncePerRequestFilter { if (node.isObject()) { ObjectNode objectNode = (ObjectNode) node; Set fieldsToRemove = new HashSet<>(); - objectNode.fieldNames().forEachRemaining(fieldName -> { + objectNode.propertyNames().forEach(fieldName -> { if (ArrayUtil.contains(excludeProperties, fieldName)) { fieldsToRemove.add(fieldName); } }); fieldsToRemove.forEach(objectNode::remove); - objectNode.elements().forEachRemaining(child -> removeSensitiveFields(child, excludeProperties)); + objectNode.values().forEach(child -> removeSensitiveFields(child, excludeProperties)); } else if (node.isArray()) { ArrayNode arrayNode = (ArrayNode) node; for (JsonNode child : arrayNode) { diff --git a/ruoyi-gateway/pom.xml b/ruoyi-gateway/pom.xml index de58ac0ba..379219df6 100644 --- a/ruoyi-gateway/pom.xml +++ b/ruoyi-gateway/pom.xml @@ -60,6 +60,11 @@ ruoyi-common-satoken
+ + org.dromara + ruoyi-common-json + + org.dromara diff --git a/ruoyi-gateway/src/main/java/org/dromara/gateway/RuoYiGatewayApplication.java b/ruoyi-gateway/src/main/java/org/dromara/gateway/RuoYiGatewayApplication.java index a20dfe450..ff64fd363 100644 --- a/ruoyi-gateway/src/main/java/org/dromara/gateway/RuoYiGatewayApplication.java +++ b/ruoyi-gateway/src/main/java/org/dromara/gateway/RuoYiGatewayApplication.java @@ -2,7 +2,6 @@ package org.dromara.gateway; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; /** @@ -10,7 +9,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt * * @author ruoyi */ -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +@SpringBootApplication public class RuoYiGatewayApplication { public static void main(String[] args) { SpringApplication application = new SpringApplication(RuoYiGatewayApplication.class); diff --git a/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java b/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java index 4b616905c..4bc4dd7eb 100644 --- a/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java +++ b/ruoyi-gateway/src/main/java/org/dromara/gateway/filter/GlobalLogFilter.java @@ -3,10 +3,6 @@ package org.dromara.gateway.filter; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.dromara.common.core.constant.SystemConstants; @@ -25,6 +21,10 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Mono; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.json.JsonMapper; +import tools.jackson.databind.node.ArrayNode; +import tools.jackson.databind.node.ObjectNode; import java.util.HashSet; import java.util.Set; @@ -65,8 +65,8 @@ public class GlobalLogFilter implements GlobalFilter, Ordered { } else { String jsonParam = WebFluxUtils.resolveBodyFromCacheRequest(exchange); if (StringUtils.isNotBlank(jsonParam)) { - ObjectMapper objectMapper = JsonUtils.getObjectMapper(); - JsonNode rootNode = objectMapper.readTree(jsonParam); + JsonMapper jsonMapper = JsonUtils.getJsonMapper(); + JsonNode rootNode = jsonMapper.readTree(jsonParam); removeSensitiveFields(rootNode, SystemConstants.EXCLUDE_PROPERTIES); jsonParam = rootNode.toString(); } @@ -102,14 +102,14 @@ public class GlobalLogFilter implements GlobalFilter, Ordered { ObjectNode objectNode = (ObjectNode) node; // 收集要删除的字段名(避免 ConcurrentModification) Set fieldsToRemove = new HashSet<>(); - objectNode.fieldNames().forEachRemaining(fieldName -> { + objectNode.propertyNames().forEach(fieldName -> { if (ArrayUtil.contains(excludeProperties, fieldName)) { fieldsToRemove.add(fieldName); } }); fieldsToRemove.forEach(objectNode::remove); // 递归处理子节点 - objectNode.elements().forEachRemaining(child -> removeSensitiveFields(child, excludeProperties)); + objectNode.values().forEach(child -> removeSensitiveFields(child, excludeProperties)); } else if (node.isArray()) { ArrayNode arrayNode = (ArrayNode) node; for (JsonNode child : arrayNode) { diff --git a/ruoyi-gateway/src/main/java/org/dromara/gateway/handler/GatewayExceptionHandler.java b/ruoyi-gateway/src/main/java/org/dromara/gateway/handler/GatewayExceptionHandler.java index e89538ec2..fa6f79278 100644 --- a/ruoyi-gateway/src/main/java/org/dromara/gateway/handler/GatewayExceptionHandler.java +++ b/ruoyi-gateway/src/main/java/org/dromara/gateway/handler/GatewayExceptionHandler.java @@ -2,7 +2,7 @@ package org.dromara.gateway.handler; import org.dromara.gateway.utils.WebFluxUtils; import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler; +import org.springframework.boot.webflux.error.ErrorWebExceptionHandler; import org.springframework.cloud.gateway.support.NotFoundException; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; diff --git a/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/RuoYiResourceApplication.java b/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/RuoYiResourceApplication.java index e3d992021..3a4372543 100644 --- a/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/RuoYiResourceApplication.java +++ b/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/RuoYiResourceApplication.java @@ -3,8 +3,8 @@ package org.dromara.resource; import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; +import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; /** * 资源服务 diff --git a/ruoyi-visual/ruoyi-monitor/pom.xml b/ruoyi-visual/ruoyi-monitor/pom.xml index 2afc02b92..5e471049a 100644 --- a/ruoyi-visual/ruoyi-monitor/pom.xml +++ b/ruoyi-visual/ruoyi-monitor/pom.xml @@ -39,10 +39,11 @@ - + org.springframework.boot - spring-boot-starter-undertow + spring-boot-starter-jetty + ${spring-boot.version}