diff --git a/README.md b/README.md index 02259741f..9fa1fe70c 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ yarn start 3.访问`http://localhost` -api("${lib.web}"){ +api(libs.web}"){ exclude module: 'spring-boot-starter-tomcat' } -"${lib.undertow}", +libs.undertow}", ## 目录说明 diff --git a/build.gradle b/build.gradle index 765b11ca2..a00673a5a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,60 +1,7 @@ plugins { - id "io.spring.dependency-management" version "${spring_dep}" - id 'org.springframework.boot' version "${spring_boot_ver}" -} - -ext { - lib = ["boot" : "org.springframework.boot:spring-boot-dependencies:${spring_boot_ver}", - "p6spy" : "p6spy:p6spy:${p6spy}", - "flyway" : "org.flywaydb:flyway-core:${flyway}", - // database - "mysql" : "mysql:mysql-connector-java:${mysql}", - "oracle" : "com.oracle.database.jdbc:ojdbc10:${oracle}", - "orai18n": "cn.easyproject:orai18n:${orai18n}", - "jaxb_api" : "javax.xml.bind:jaxb-api:${jaxb_api}", - "truelicense" : "de.schlichtherle.truelicense:truelicense-core:${truelicense}", - "jasypt" : "com.github.ulisesbocchio:jasypt-spring-boot-starter:${jasypt}", - "validation" : "org.springframework.boot:spring-boot-starter-validation", - "json" : "org.springframework.boot:spring-boot-starter-json", - "jsr310" : "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jsr310}", - // lombok - "lombok" : "org.projectlombok:lombok:${lombok}", - // cache - "caffeine" : "com.github.ben-manes.caffeine:caffeine:${caffeine}", - "redis" : "org.springframework.boot:spring-boot-starter-data-redis", - "cache" : "org.springframework.boot:spring-boot-starter-cache", - // AOP - "aop" : "org.springframework.boot:spring-boot-starter-aop", - "jdbc" : "org.springframework.boot:spring-boot-starter-jdbc", - // security - "security" : "org.springframework.boot:spring-boot-starter-security", - // web - "web" : "org.springframework.boot:spring-boot-starter-web", - "undertow" : "org.springframework.boot:spring-boot-starter-undertow", - // test - "test" : "org.springframework.boot:spring-boot-starter-test", - "securityTest" : "org.springframework.security:spring-security-test:${securityTest}", - // hutool - "hutool" : "cn.hutool:hutool-all:${hutool}", - // mybatis - "mybatisPlus" : "com.baomidou:mybatis-plus-boot-starter:${mybatis_plus_starter}", - // 文档聚合 - "springdoc" : "org.springdoc:springdoc-openapi-starter-webmvc-api:${springdoc}", - "springdocui" : "org.springdoc:springdoc-openapi-starter-webmvc-ui:${springdoc}", - // swagger - "knife4j_ui" : "com.github.xiaoymin:knife4j-openapi3-ui:${knife4j}", - // jwt - "jwt": "com.nimbusds:nimbus-jose-jwt:${jwt}", - // 线程增强 - "ttl": "com.alibaba:transmittable-thread-local:${ttl}", - // websocket - "websocket": "org.springframework.boot:spring-boot-starter-websocket", - "devTools" : "org.springframework.boot:spring-boot-devtools", - "actuator" : "org.springframework.boot:spring-boot-starter-actuator", - "prometheus" : "io.micrometer:micrometer-registry-prometheus:1.14.1", - //文件上传minIO - "minio" : "io.minio:minio:${minio}" - ] + alias(libs.plugins.spring.dependency.management) + alias(libs.plugins.spring.boot) + alias(libs.plugins.ben.manes.versions) } allprojects { @@ -69,18 +16,6 @@ subprojects { apply plugin: 'io.spring.dependency-management' - java { - toolchain { - languageVersion = JavaLanguageVersion.of(21) - } - } - - dependencyManagement { - imports { - mavenBom "${lib.boot}" - } - } - tasks.withType(JavaCompile).configureEach { options.encoding = "UTF-8" } @@ -113,11 +48,12 @@ subprojects { } dependencies { - implementation "${lib.lombok}" - annotationProcessor "${lib.lombok}" + implementation platform(libs.boot) + implementation libs.lombok + annotationProcessor libs.lombok - testImplementation "${lib.test}", - "${lib.securityTest}" + testImplementation libs.test, + libs.security.test } } diff --git a/eva-core/eva-core-cache/build.gradle b/eva-core/eva-core-cache/build.gradle index d18bb7e1c..71593fe9e 100644 --- a/eva-core/eva-core-cache/build.gradle +++ b/eva-core/eva-core-cache/build.gradle @@ -7,7 +7,7 @@ project.description='eva cache , redis && caffeine' dependencies { implementation project(":eva-core:eva-core-common") - api "${lib.cache}", - "${lib.redis}", - "${lib.caffeine}" + api libs.cache, + libs.redis, + libs.caffeine } diff --git a/eva-core/eva-core-common/build.gradle b/eva-core/eva-core-common/build.gradle index bd9d90592..e12fa0634 100644 --- a/eva-core/eva-core-common/build.gradle +++ b/eva-core/eva-core-common/build.gradle @@ -5,14 +5,14 @@ project.archivesBaseName = 'eva-core-common' project.description='eva common class' dependencies { - implementation "${lib.jaxb_api}", - "${lib.jasypt}" + implementation libs.jaxb.api, + libs.jasypt - api "${lib.hutool}", - "${lib.aop}", - "${lib.jwt}", - "${lib.json}", - "${lib.ttl}", - "${lib.validation}" + api libs.hutool, + libs.aop, + libs.jwt, + libs.json, + libs.ttl, + libs.validation } diff --git a/eva-core/eva-core-data-mybatis/build.gradle b/eva-core/eva-core-data-mybatis/build.gradle index 86859949e..4bf37b379 100644 --- a/eva-core/eva-core-data-mybatis/build.gradle +++ b/eva-core/eva-core-data-mybatis/build.gradle @@ -7,10 +7,10 @@ project.description='eva mybatis support' dependencies { implementation project(":eva-core:eva-core-common"), project(":eva-core:eva-core-log"), - "${lib.jdbc}", - "${lib.p6spy}", - "${lib.flyway}", - "${lib.springdoc}" + libs.jdbc, + libs.p6spy, + libs.flyway, + libs.springdoc - api "${lib.mybatisPlus}" + api libs.mybatis.plus.starter } diff --git a/eva-core/eva-core-license/build.gradle b/eva-core/eva-core-license/build.gradle index 3f0f72f19..c06f8c7c6 100644 --- a/eva-core/eva-core-license/build.gradle +++ b/eva-core/eva-core-license/build.gradle @@ -6,12 +6,12 @@ project.description='eva license support' dependencies { - implementation("${lib.web}"){ + implementation(libs.web){ exclude module: 'spring-boot-starter-tomcat' } implementation project(":eva-core:eva-core-common"), - "${lib.undertow}" + libs.undertow - api "${lib.truelicense}" + api libs.truelicense } diff --git a/eva-core/eva-core-log/build.gradle b/eva-core/eva-core-log/build.gradle index 0536594c0..bdeb8b0c9 100644 --- a/eva-core/eva-core-log/build.gradle +++ b/eva-core/eva-core-log/build.gradle @@ -6,5 +6,5 @@ project.description='eva log support' dependencies { implementation project(":eva-core:eva-core-common"), - "${lib.jdbc}" + libs.jdbc } diff --git a/eva-core/eva-core-upload/build.gradle b/eva-core/eva-core-upload/build.gradle index 60afa64c5..6e613583b 100644 --- a/eva-core/eva-core-upload/build.gradle +++ b/eva-core/eva-core-upload/build.gradle @@ -6,11 +6,11 @@ project.description='eva fileupload support ' dependencies { - implementation("${lib.web}"){ + implementation(libs.web){ exclude module: 'spring-boot-starter-tomcat' } - implementation "${lib.undertow}", - "${lib.minio}" + implementation libs.undertow, + libs.minio implementation project(":eva-core:eva-core-common") } diff --git a/eva-core/eva-core-web/build.gradle b/eva-core/eva-core-web/build.gradle index a75840ba8..10b31f57d 100644 --- a/eva-core/eva-core-web/build.gradle +++ b/eva-core/eva-core-web/build.gradle @@ -6,11 +6,11 @@ project.description='eva web support with all base modules' dependencies { - api("${lib.web}"){ + api(libs.web){ exclude module: 'spring-boot-starter-tomcat' } - api "${lib.undertow}" + api libs.undertow api project(":eva-core:eva-core-common"), - "${lib.springdoc}" + libs.springdoc } diff --git a/eva-core/eva-core-websocket/build.gradle b/eva-core/eva-core-websocket/build.gradle index fb982ef51..f0d428926 100644 --- a/eva-core/eva-core-websocket/build.gradle +++ b/eva-core/eva-core-websocket/build.gradle @@ -5,11 +5,11 @@ project.archivesBaseName = 'eva-core-websocket' project.description = "tool for websocket" dependencies { - implementation("${lib.websocket}"){ + implementation(libs.websocket){ exclude module: 'spring-boot-starter-tomcat' } - implementation "${lib.undertow}" + implementation libs.undertow implementation project(":eva-core:eva-core-common") diff --git a/eva-server/eva-license-server/build.gradle b/eva-server/eva-license-server/build.gradle index 9bc726a4c..3e30cd7d9 100644 --- a/eva-server/eva-license-server/build.gradle +++ b/eva-server/eva-license-server/build.gradle @@ -14,10 +14,10 @@ description = """license""" // 依赖配置 dependencies { // 使用undertow替代tomcat - implementation("${lib.web}"){ + implementation(libs.web){ exclude module: 'spring-boot-starter-tomcat' } - implementation "${lib.hutool}", - "${lib.truelicense}" + implementation libs.hutool, + libs.truelicense } diff --git a/eva-web/eva-web-auth/build.gradle b/eva-web/eva-web-auth/build.gradle index 1f3522a24..0e16341b1 100644 --- a/eva-web/eva-web-auth/build.gradle +++ b/eva-web/eva-web-auth/build.gradle @@ -10,6 +10,6 @@ dependencies { project(":eva-core:eva-core-data-mybatis"), project(":eva-core:eva-core-cache"), project(":eva-web:eva-web-sys"), - "${lib.mysql}", - "${lib.security}" + libs.mysql, + libs.security } diff --git a/eva-web/eva-web-sys/build.gradle b/eva-web/eva-web-sys/build.gradle index b50ef96a0..12c0bfef7 100644 --- a/eva-web/eva-web-sys/build.gradle +++ b/eva-web/eva-web-sys/build.gradle @@ -8,5 +8,5 @@ dependencies { implementation project(":eva-core:eva-core-web"), project(":eva-core:eva-core-data-mybatis"), project(":eva-core:eva-core-cache"), - "${lib.mysql}" + libs.mysql } diff --git a/gradle.properties b/gradle.properties index 317020095..0b6913201 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,27 +1,6 @@ profile=aliyun -spring_dep=1.1.6 -spring_boot_ver=3.3.5 -ttl=2.14.5 -mysql=8.0.33 -mybatis_plus_starter=3.5.8 -lombok=1.18.34 -knife4j=4.5.0 -hutool=5.8.32 -jaxb_api=2.3.1 -jasypt=3.0.5 -p6spy=3.9.1 -flyway=10.20.1 -boot_admin=3.1.6 -truelicense=1.33 -caffeine=3.1.8 -securityTest=6.3.4 -jwt=9.45 -jsr310=2.18.1 -oracle=19.24.0.0 -orai18n=12.1.0.2.0 -springdoc=2.6.0 -minio=8.5.13 +java.runtime.version=21 org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC systemProp.file.encoding=UTF-8 org.gradle.parallel=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..694968b5a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,68 @@ +[versions] +spring-dep = "1.1.6" +spring-boot = "3.3.5" +ttl = "2.14.5" +mysql = "8.0.33" +mybatis-plus-starter = "3.5.8" +lombok = "1.18.34" +knife4j = "4.5.0" +hutool = "5.8.32" +jaxb-api = "2.3.1" +jasypt = "3.0.5" +p6spy = "3.9.1" +flyway = "10.20.1" +boot-admin = "3.1.6" +truelicense = "1.33" +caffeine = "3.1.8" +security-test = "6.3.4" +jwt = "9.45" +jsr310 = "2.18.1" +oracle = "19.24.0.0" +orai18n = "12.1.0.2.0" +springdoc = "2.6.0" +minio = "8.5.13" +prometheus = "1.14.1" +versioncheck = "0.51.0" + +[libraries] +boot = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "spring-boot" } +p6spy = { module = "p6spy:p6spy", version.ref = "p6spy" } +flyway = { module = "org.flywaydb:flyway-core", version.ref = "flyway" } +mysql = { module = "mysql:mysql-connector-java", version.ref = "mysql" } +oracle = { module = "com.oracle.database.jdbc:ojdbc10", version.ref = "oracle" } +orai18n = { module = "cn.easyproject:orai18n", version.ref = "orai18n" } +jaxb-api = { module = "javax.xml.bind:jaxb-api", version.ref = "jaxb-api" } +truelicense = { module = "de.schlichtherle.truelicense:truelicense-core", version.ref = "truelicense" } +jasypt = { module = "com.github.ulisesbocchio:jasypt-spring-boot-starter", version.ref = "jasypt" } +validation = { module = "org.springframework.boot:spring-boot-starter-validation" } +json = { module = "org.springframework.boot:spring-boot-starter-json" } +jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jsr310" } +lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" } +caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" } +redis = { module = "org.springframework.boot:spring-boot-starter-data-redis" } +cache = { module = "org.springframework.boot:spring-boot-starter-cache" } +aop = { module = "org.springframework.boot:spring-boot-starter-aop" } +jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc" } +security = { module = "org.springframework.boot:spring-boot-starter-security" } +web = { module = "org.springframework.boot:spring-boot-starter-web" } +undertow = { module = "org.springframework.boot:spring-boot-starter-undertow" } +test = { module = "org.springframework.boot:spring-boot-starter-test" } +security-test = { module = "org.springframework.security:spring-security-test", version.ref = "security-test" } +hutool = { module = "cn.hutool:hutool-all", version.ref = "hutool" } +mybatis-plus-starter = { module = "com.baomidou:mybatis-plus-boot-starter", version.ref = "mybatis-plus-starter" } +springdoc = { module = "org.springdoc:springdoc-openapi-starter-webmvc-api", version.ref = "springdoc" } +springdocui = { module = "org.springdoc:springdoc-openapi-starter-webmvc-ui", version.ref = "springdoc" } +knife4j-ui = { module = "com.github.xiaoymin:knife4j-openapi3-ui", version.ref = "knife4j" } +jwt = { module = "com.nimbusds:nimbus-jose-jwt", version.ref = "jwt" } +ttl = { module = "com.alibaba:transmittable-thread-local", version.ref = "ttl" } +websocket = { module = "org.springframework.boot:spring-boot-starter-websocket" } +dev-tools = { module = "org.springframework.boot:spring-boot-devtools" } +actuator = { module = "org.springframework.boot:spring-boot-starter-actuator" } +prometheus = { module = "io.micrometer:micrometer-registry-prometheus", version.ref = "prometheus" } +minio = { module = "io.minio:minio", version.ref = "minio" } + + +[plugins] +spring_dependency_management = { id = "io.spring.dependency-management", version.ref = "spring-dep" } +spring_boot = { id = "org.springframework.boot", version.ref = "spring-boot" } +ben_manes_versions = { id = "com.github.ben-manes.versions", version.ref = "versioncheck" } diff --git a/web-booter/build.gradle b/web-booter/build.gradle index 14be5cd32..3b3a5e932 100644 --- a/web-booter/build.gradle +++ b/web-booter/build.gradle @@ -31,14 +31,14 @@ dependencies { api project(":eva-core:eva-core-web"), project(":eva-core:eva-core-data-mybatis"), project(":eva-web:eva-web-auth"), - "${lib.mysql}" + libs.mysql - implementation "${lib.springdocui}", - "${lib.prometheus}", - "${lib.actuator}", - "${lib.knife4j_ui}" + implementation libs.springdocui, + libs.prometheus, + libs.actuator, + libs.knife4j.ui -// "${lib.devTools}" +// libs.devTools } \ No newline at end of file