mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-29 22:27:31 +00:00
build: 将 Maven 发布仓库从 Github Repo 改为自建 Nexus 仓库.
由于 Github 自建仓库在 SNAPSHOT 版本上存在问题, 故修改发布配置以转移到自建的 Nexus 仓库.
This commit is contained in:
parent
95ad251826
commit
a44732a7f6
@ -38,24 +38,21 @@ tasks.withType<KotlinCompile> {
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
val repoRootKey = "maven.repo.local.root"
|
if (project.version.toString().endsWith("-SNAPSHOT")) {
|
||||||
val snapshot = project.version.toString().endsWith("-SNAPSHOT")
|
maven("https://repo.lamgc.moe/repository/maven-snapshots/") {
|
||||||
val repoRoot = System.getProperty(repoRootKey)?.trim()
|
credentials {
|
||||||
if (repoRoot == null || repoRoot.isEmpty()) {
|
username = project.properties["repo.credentials.private.username"].toString()
|
||||||
logger.warn(
|
password = project.properties["repo.credentials.private.password"].toString()
|
||||||
"\"$repoRootKey\" configuration item is not specified, " +
|
}
|
||||||
"please add start parameter \"-D$repoRootKey {localPublishRepo}\"" +
|
}
|
||||||
" (if you are not currently executing the publish task, " +
|
|
||||||
"you can ignore this information)"
|
|
||||||
)
|
|
||||||
return@repositories
|
|
||||||
}
|
|
||||||
val repoUri = if (snapshot) {
|
|
||||||
uri("$repoRoot/snapshots")
|
|
||||||
} else {
|
} else {
|
||||||
uri("$repoRoot/releases")
|
maven("https://repo.lamgc.moe/repository/maven-releases/") {
|
||||||
|
credentials {
|
||||||
|
username = project.properties["repo.credentials.private.username"].toString()
|
||||||
|
password = project.properties["repo.credentials.private.password"].toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
maven(repoUri)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publications {
|
publications {
|
||||||
|
Loading…
Reference in New Issue
Block a user