From b9bfa88d990723b31915548bc8a7c624234c5892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=84=E9=94=90=E6=B3=A2?= <10549902+zhuangruibo@user.noreply.gitee.com> Date: Fri, 22 May 2026 12:45:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B7=A5=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit ba9a6c14a58c3f762c205032088306163d77e771) --- Libs/install-to-maven.ps1 | 45 +++++++++++++++++++++++++++++++++----- Libs/zdxt-common-5.6.0.pom | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 Libs/zdxt-common-5.6.0.pom diff --git a/Libs/install-to-maven.ps1 b/Libs/install-to-maven.ps1 index 3c5fed5..7a46b71 100644 --- a/Libs/install-to-maven.ps1 +++ b/Libs/install-to-maven.ps1 @@ -1,11 +1,49 @@ # 将 Libs 目录下的所有 *.jar 安装到本地 Maven 仓库 # groupId: org.dromara, version: 5.6.0 +# 安装顺序:根POM → 纯POM父模块 → JAR(确保 parent 链完整) # 若同目录存在同名 .pom 文件,则使用真实 POM(传递依赖完整);否则自动生成空 POM。 $libsDir = $PSScriptRoot $groupId = "org.dromara" $version = "5.6.0" +# ====== 第一步:安装根 POM(提供 dependencyManagement) ====== +Write-Host "`n=== Step 1: Installing root POM (EnforcementCode) ===" -ForegroundColor Magenta +$rootPomPath = (Resolve-Path (Join-Path $libsDir "..\pom.xml")).Path +if (Test-Path $rootPomPath) { + mvn install:install-file ` + "-Dfile=$rootPomPath" ` + "-DgroupId=$groupId" ` + "-DartifactId=EnforcementCode" ` + "-Dversion=$version" ` + "-Dpackaging=pom" + if ($LASTEXITCODE -eq 0) { Write-Host " -> OK" -ForegroundColor Green } + else { Write-Host " -> FAILED" -ForegroundColor Red } +} else { + Write-Host " -> Root pom.xml not found at $rootPomPath, skipping" -ForegroundColor Yellow +} + +# ====== 第二步:安装纯 POM 父模块(只有 .pom 没有对应 .jar 的文件) ====== +Write-Host "`n=== Step 2: Installing parent POMs (no matching JAR) ===" -ForegroundColor Magenta +Get-ChildItem -Path $libsDir -Filter "*.pom" | Where-Object { + $jarName = $_.BaseName + ".jar" + -not (Test-Path (Join-Path $libsDir $jarName)) +} | ForEach-Object { + $pomFile = $_.FullName + $artifactId = $_.BaseName -replace "-$version$", "" + Write-Host "Installing POM: $artifactId" -ForegroundColor Cyan + mvn install:install-file ` + "-Dfile=$pomFile" ` + "-DgroupId=$groupId" ` + "-DartifactId=$artifactId" ` + "-Dversion=$version" ` + "-Dpackaging=pom" + if ($LASTEXITCODE -eq 0) { Write-Host " -> OK" -ForegroundColor Green } + else { Write-Host " -> FAILED" -ForegroundColor Red } +} + +# ====== 第三步:安装 JAR(使用真实 POM 或生成空 POM) ====== +Write-Host "`n=== Step 3: Installing JARs ===" -ForegroundColor Magenta Get-ChildItem -Path $libsDir -Filter "*.jar" | ForEach-Object { $jarFile = $_.FullName # 从文件名中提取 artifactId,例如 zdxt-common-core-5.6.0.jar -> zdxt-common-core @@ -29,11 +67,8 @@ Get-ChildItem -Path $libsDir -Filter "*.jar" | ForEach-Object { "-DgeneratePom=true" } - if ($LASTEXITCODE -eq 0) { - Write-Host " -> OK" -ForegroundColor Green - } else { - Write-Host " -> FAILED" -ForegroundColor Red - } + if ($LASTEXITCODE -eq 0) { Write-Host " -> OK" -ForegroundColor Green } + else { Write-Host " -> FAILED" -ForegroundColor Red } } Write-Host "`nAll done." -ForegroundColor Yellow diff --git a/Libs/zdxt-common-5.6.0.pom b/Libs/zdxt-common-5.6.0.pom new file mode 100644 index 0000000..becf715 --- /dev/null +++ b/Libs/zdxt-common-5.6.0.pom @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.dromara + EnforcementCode + 5.6.0 + + org.dromara + zdxt-common + 5.6.0 + pom + common 通用模块 + + zdxt-common-bom + zdxt-common-social + zdxt-common-core + zdxt-common-doc + zdxt-common-excel + zdxt-common-idempotent + zdxt-common-log + zdxt-common-mail + zdxt-common-mybatis + zdxt-common-oss + zdxt-common-ratelimiter + zdxt-common-redis + zdxt-common-satoken + zdxt-common-security + zdxt-common-sms + zdxt-common-web + zdxt-common-translation + zdxt-common-sensitive + zdxt-common-json + zdxt-common-encrypt + zdxt-common-tenant + zdxt-common-websocket + zdxt-common-sse + zdxt-common-quartz + +