You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
929 B
30 lines
929 B
# 将 Libs 目录下的所有 zdxt-common-*.jar 安装到本地 Maven 仓库
|
|
# groupId: org.dromara, version: 5.6.0
|
|
|
|
$libsDir = $PSScriptRoot
|
|
$groupId = "org.dromara"
|
|
$version = "5.6.0"
|
|
|
|
Get-ChildItem -Path $libsDir -Filter "*.jar" | ForEach-Object {
|
|
$jarFile = $_.FullName
|
|
# 从文件名中提取 artifactId,例如 zdxt-common-core-5.6.0.jar -> zdxt-common-core
|
|
$artifactId = $_.BaseName -replace "-$version$", ""
|
|
|
|
Write-Host "Installing: $artifactId ($jarFile)" -ForegroundColor Cyan
|
|
|
|
mvn install:install-file `
|
|
"-Dfile=$jarFile" `
|
|
"-DgroupId=$groupId" `
|
|
"-DartifactId=$artifactId" `
|
|
"-Dversion=$version" `
|
|
"-Dpackaging=jar" `
|
|
"-DgeneratePom=true"
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host " -> OK" -ForegroundColor Green
|
|
} else {
|
|
Write-Host " -> FAILED" -ForegroundColor Red
|
|
}
|
|
}
|
|
|
|
Write-Host "`nAll done." -ForegroundColor Yellow
|
|
|