build(gradle): Update the project build configuration

- Remove invalid Maven repositories
- Add the Kotlin kapt plugin
- Modify the version number increment rule
- Update the submodule name and structure
- Adjusted the inclusion of the internationalization (i18n) and trace modules
- Remove references to common modules
This commit is contained in:
gewuyou 2025-05-28 21:58:18 +08:00
parent b44b5a1570
commit b58cb6b339
4 changed files with 47 additions and 44 deletions

View File

@ -8,6 +8,8 @@ plugins {
alias(libs.plugins.axionRelease) alias(libs.plugins.axionRelease)
// Kotlin Spring 支持 // Kotlin Spring 支持
alias(libs.plugins.kotlin.plugin.spring) alias(libs.plugins.kotlin.plugin.spring)
// Kotlin kapt 支持
alias (libs.plugins.kotlin.kapt)
} }
// 配置 SCM 版本插件 // 配置 SCM 版本插件
@ -15,7 +17,7 @@ scmVersion {
tag { tag {
prefix.set("") // 不加 v生成 1.0.1 而不是 v1.0.1 prefix.set("") // 不加 v生成 1.0.1 而不是 v1.0.1
} }
versionIncrementer("incrementMinorIfNotOnRelease") versionIncrementer("incrementPatch")
hooks { hooks {
pre( pre(
"fileUpdate", mapOf( "fileUpdate", mapOf(
@ -58,13 +60,13 @@ allprojects {
// 子项目配置 // 子项目配置
subprojects { subprojects {
version = rootProject.version version = rootProject.version
afterEvaluate { afterEvaluate {
val isRootModule = project.getPropertyByBoolean(ProjectFlags.IS_ROOT_MODULE) val isRootModule = project.getPropertyByBoolean(ProjectFlags.IS_ROOT_MODULE)
val isStarterModule = project.name.contains("starter")
val parentProject = project.parent val parentProject = project.parent
// 让父项目引入子项目 // 让父项目引入子项目
parentProject?.dependencies?.add("api", project(project.path)) parentProject?.dependencies?.add("api", project(project.path))
if (isStarterModule && !isRootModule) { if (!isRootModule) {
// Starter 模块依赖配置 // Starter 模块依赖配置
dependencies { dependencies {
implementation(platform(libs.springBootDependencies.bom)) implementation(platform(libs.springBootDependencies.bom))
@ -81,19 +83,19 @@ subprojects {
plugin(libs.plugins.maven.publish.get().pluginId) plugin(libs.plugins.maven.publish.get().pluginId)
plugin(libs.plugins.kotlin.jvm.get().pluginId) plugin(libs.plugins.kotlin.jvm.get().pluginId)
plugin(libs.plugins.axionRelease.get().pluginId) plugin(libs.plugins.axionRelease.get().pluginId)
plugin(libs.plugins.kotlin.kapt.get().pluginId)
// 导入仓库配置 // 导入仓库配置
from(file("$configDir/repositories.gradle.kts")) from(file("$configDir/repositories.gradle.kts"))
// 导入源代码任务 // 导入源代码任务
from(file("$tasksDir/sourceTask.gradle.kts")) from(file("$tasksDir/sourceTask.gradle.kts"))
} }
// 发布配置 // 发布配置
publishing { publishing {
repositories { repositories {
// 本地仓库 // 本地仓库
maven { maven {
name = "localRepo" name = "localRepo"
url = uri("file://D:/Maven/mvn_repository") url = uri("file://D:/Config/Jrebel/.jrebel/.m2/repository")
} }
// GitHub Packages 仓库 // GitHub Packages 仓库
maven { maven {

View File

@ -8,12 +8,6 @@ repositories {
isAllowInsecureProtocol = true isAllowInsecureProtocol = true
} }
} }
maven {
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
}
maven {
url = uri("https://raw.githubusercontent.com/eurotech/kura_addons/mvn-repo/")
}
maven { maven {
url = uri("https://maven.aliyun.com/repository/public/") url = uri("https://maven.aliyun.com/repository/public/")
} }

View File

@ -27,6 +27,7 @@ springBootDependencies-bom = { module = "org.springframework.boot:spring-boot-de
springBootStarter-aop = { group = "org.springframework.boot", name = "spring-boot-starter-aop" } springBootStarter-aop = { group = "org.springframework.boot", name = "spring-boot-starter-aop" }
springBootStarter-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" } springBootStarter-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" }
springBootStarter-webflux = { group = "org.springframework.boot", name = "spring-boot-starter-webflux" } springBootStarter-webflux = { group = "org.springframework.boot", name = "spring-boot-starter-webflux" }
springBootStarter-validation = { group = "org.springframework.boot", name = "spring-boot-starter-validation" }
springBoot-configuration-processor = { group = "org.springframework.boot", name = "spring-boot-configuration-processor", version.ref = "spring-boot-version" } springBoot-configuration-processor = { group = "org.springframework.boot", name = "spring-boot-configuration-processor", version.ref = "spring-boot-version" }
springCloudDependencies-bom = { module = "org.springframework.cloud:spring-cloud-dependencies", version.ref = "spring-cloud-version" } springCloudDependencies-bom = { module = "org.springframework.cloud:spring-cloud-dependencies", version.ref = "spring-cloud-version" }
@ -63,3 +64,5 @@ maven-publish = { id = "maven-publish" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-version" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-version" }
# 支持 Spring 的 Kotlin 插件 # 支持 Spring 的 Kotlin 插件
kotlin-plugin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin-version" } kotlin-plugin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin-version" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt" }
forgeboot-i18n-keygen = { id = "i18n-key-gen" }

View File

@ -26,12 +26,18 @@ rootProject.name = "forgeboot"
//region module webmvc //region module webmvc
include( include(
"forgeboot-webmvc", "forgeboot-webmvc",
":forgeboot-webmvc:forgeboot-webmvc-version-starter", ":forgeboot-webmvc:version",
":forgeboot-webmvc:forgeboot-webmvc-logger-starter" ":forgeboot-webmvc:logger",
":forgeboot-webmvc:exception",
":forgeboot-webmvc:dto",
":forgeboot-webmvc:validation"
) )
project(":forgeboot-webmvc").name = "forgeboot-webmvc-spring-boot-starter" project(":forgeboot-webmvc").name = "forgeboot-webmvc-spring-boot-starter"
project(":forgeboot-webmvc:forgeboot-webmvc-version-starter").name = "forgeboot-webmvc-version-spring-boot-starter" project(":forgeboot-webmvc:version").name = "forgeboot-webmvc-version-spring-boot-starter"
project(":forgeboot-webmvc:forgeboot-webmvc-logger-starter").name = "forgeboot-webmvc-logger-spring-boot-starter" project(":forgeboot-webmvc:logger").name = "forgeboot-webmvc-logger-spring-boot-starter"
project(":forgeboot-webmvc:exception").name = "forgeboot-webmvc-exception-spring-boot-starter"
project(":forgeboot-webmvc:dto").name = "forgeboot-webmvc-dto"
project(":forgeboot-webmvc:validation").name = "forgeboot-validation"
//endregion //endregion
//region module core //region module core
@ -45,35 +51,33 @@ project(":forgeboot-core:forgeboot-core-extension").name = "forgeboot-core-exten
//region module i18n //region module i18n
include( include(
"forgeboot-i18n" "forgeboot-i18n",
":forgeboot-i18n:forgeboot-i18n-api",
":forgeboot-i18n:forgeboot-i18n-impl",
":forgeboot-i18n:forgeboot-i18n-autoconfigure"
) )
project(":forgeboot-i18n").name = "forgeboot-i18n-spring-boot-starter" project(":forgeboot-i18n").name = "forgeboot-i18n-spring-boot-starter"
project(":forgeboot-i18n:forgeboot-i18n-api").name = "forgeboot-i18n-api"
project(":forgeboot-i18n:forgeboot-i18n-impl").name = "forgeboot-i18n-impl"
project(":forgeboot-i18n:forgeboot-i18n-autoconfigure").name = "forgeboot-i18n-autoconfigure"
//endregion //endregion
//region module webflux //region module webflux
include( //include(
"forgeboot-webflux", // "forgeboot-webflux",
) //)
project(":forgeboot-webflux").name = "forgeboot-webflux-spring-boot-starter" //project(":forgeboot-webflux").name = "forgeboot-webflux-spring-boot-starter"
//endregion //endregion
//region module trace //region module trace
include( include(
"forgeboot-trace" "forgeboot-trace",
":forgeboot-trace:forgeboot-trace-api",
":forgeboot-trace:forgeboot-trace-impl",
":forgeboot-trace:forgeboot-trace-autoconfigure",
) )
project(":forgeboot-trace").name = "forgeboot-trace-spring-boot-starter" project(":forgeboot-trace").name = "forgeboot-trace-spring-boot-starter"
//endregion project(":forgeboot-trace:forgeboot-trace-api").name = "forgeboot-trace-api"
project(":forgeboot-trace:forgeboot-trace-impl").name = "forgeboot-trace-impl"
//region module common project(":forgeboot-trace:forgeboot-trace-autoconfigure").name = "forgeboot-trace-autoconfigure"
include(
"forgeboot-common",
":forgeboot-common:forgeboot-common-result",
":forgeboot-common:forgeboot-common-result:forgeboot-common-result-api",
":forgeboot-common:forgeboot-common-result:forgeboot-common-result-impl",
// ":forgeboot-common:forgeboot-common-result:forgeboot-common-result-extension",
)
project(":forgeboot-common").name = "forgeboot-common"
project(":forgeboot-common:forgeboot-common-result").name = "forgeboot-common-result"
project(":forgeboot-common:forgeboot-common-result:forgeboot-common-result-api").name = "forgeboot-common-result-api"
project(":forgeboot-common:forgeboot-common-result:forgeboot-common-result-impl").name = "forgeboot-common-result-impl"
//endregion //endregion