Skip to content

Commit

Permalink
使用toml对依赖进行管理
Browse files Browse the repository at this point in the history
  • Loading branch information
pkaq committed Dec 11, 2024
1 parent 7bf8685 commit 2c3fb53
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 136 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}",

## 目录说明

Expand Down
80 changes: 8 additions & 72 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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"
}
Expand Down Expand Up @@ -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

}
}
Expand Down
6 changes: 3 additions & 3 deletions eva-core/eva-core-cache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
16 changes: 8 additions & 8 deletions eva-core/eva-core-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
10 changes: 5 additions & 5 deletions eva-core/eva-core-data-mybatis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions eva-core/eva-core-license/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion eva-core/eva-core-log/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ project.description='eva log support'

dependencies {
implementation project(":eva-core:eva-core-common"),
"${lib.jdbc}"
libs.jdbc
}
6 changes: 3 additions & 3 deletions eva-core/eva-core-upload/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
6 changes: 3 additions & 3 deletions eva-core/eva-core-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions eva-core/eva-core-websocket/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 3 additions & 3 deletions eva-server/eva-license-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
4 changes: 2 additions & 2 deletions eva-web/eva-web-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion eva-web/eva-web-sys/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
23 changes: 1 addition & 22 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
68 changes: 68 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
12 changes: 6 additions & 6 deletions web-booter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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


}

0 comments on commit 2c3fb53

Please sign in to comment.