Refactor dependencies and plugins with version catelog

pull/7449/head
John Niang 2025-05-19 16:05:56 +08:00
parent 2ca731f10a
commit e6f753bb5d
No known key found for this signature in database
GPG Key ID: D7363C015BBCAA59
6 changed files with 80 additions and 69 deletions

View File

@ -2,8 +2,8 @@ plugins {
id 'java-library' id 'java-library'
id 'halo.publish' id 'halo.publish'
id 'jacoco' id 'jacoco'
id "io.freefair.lombok" alias(libs.plugins.lombok)
id "com.github.ben-manes.versions" alias(libs.plugins.versions)
} }
group = 'run.halo.app' group = 'run.halo.app'

View File

@ -2,18 +2,18 @@ import de.undercouch.gradle.tasks.download.Download
import org.gradle.crypto.checksum.Checksum import org.gradle.crypto.checksum.Checksum
plugins { plugins {
id 'org.springframework.boot'
id 'io.spring.dependency-management'
id "com.gorylenko.gradle-git-properties"
id "checkstyle" id "checkstyle"
id 'java' id 'java'
id 'idea' id 'idea'
id 'jacoco' id 'jacoco'
id "de.undercouch.download" alias(libs.plugins.spring.boot)
id "io.freefair.lombok" alias(libs.plugins.spring.dependency.management)
id 'org.gradle.crypto.checksum' alias(libs.plugins.git.properties)
id 'org.springdoc.openapi-gradle-plugin' alias(libs.plugins.undercouch.download)
id "com.github.ben-manes.versions" alias(libs.plugins.lombok)
alias(libs.plugins.checksum)
alias(libs.plugins.springdoc.openapi)
alias(libs.plugins.versions)
} }
group = 'run.halo.app' group = 'run.halo.app'

View File

@ -1,11 +0,0 @@
plugins {
id 'org.springframework.boot' version '3.4.5' apply false
id 'io.spring.dependency-management' version '1.1.7' apply false
id "com.gorylenko.gradle-git-properties" version "2.4.1" apply false
id "de.undercouch.download" version "5.6.0" apply false
id "io.freefair.lombok" version "8.6" apply false
id 'org.gradle.crypto.checksum' version '1.4.0' apply false
id "com.github.node-gradle.node" version "7.0.2" apply false
id "org.springdoc.openapi-gradle-plugin" version "1.9.0" apply false
id "com.github.ben-manes.versions" version "0.51.0" apply false
}

51
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,51 @@
[versions]
lucene = '9.12.0'
resilience4j = '2.2.0'
therapi = '0.13.0'
[libraries]
lucene-core = { module = 'org.apache.lucene:lucene-core', version.ref = 'lucene' }
lucene-queryparser = { module = 'org.apache.lucene:lucene-queryparser', version.ref = 'lucene' }
lucene-highlighter = { module = 'org.apache.lucene:lucene-highlighter', version.ref = 'lucene' }
lucene-backward-codecs = { module = 'org.apache.lucene:lucene-backward-codecs', version.ref = 'lucene' }
lucene-analyzers-common = { module = 'org.apache.lucene:lucene-analysis-common', version.ref = 'lucene' }
therapi-runtime-javadoc = { module = 'com.github.therapi:therapi-runtime-javadoc', version.ref = 'therapi' }
therapi-runtime-javadoc-scribe = { module = 'com.github.therapi:therapi-runtime-javadoc-scribe', version.ref = 'therapi' }
resilience4j-springboot3 = { module = 'io.github.resilience4j:resilience4j-spring-boot3', version.ref = 'resilience4j' }
resilience4j-reactor = { module = 'io.github.resilience4j:resilience4j-reactor', version.ref = 'resilience4j' }
apache-commons-lang3 = 'org.apache.commons:commons-lang3:3.12.0'
apache-tika-core = 'org.apache.tika:tika-core:2.9.2'
encoding-base62 = 'io.seruco.encoding:base62:0.1.3'
pf4j = 'org.pf4j:pf4j:3.13.0'
guava = 'com.google.guava:guava:33.3.1-jre'
java-diff-utils = 'io.github.java-diff-utils:java-diff-utils:4.15'
jsoup = 'org.jsoup:jsoup:1.18.1'
json-patch = 'com.github.java-json-tools:json-patch:1.13'
springdoc-openapi = 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.8.8'
openapi-schema-validator = 'org.openapi4j:openapi-schema-validator:1.0.7'
bouncycastle-bcpkix = 'org.bouncycastle:bcpkix-jdk18on:1.80'
twofactor-auth = 'com.j256.two-factor-auth:two-factor-auth:1.3'
imgscalr-lib = 'org.imgscalr:imgscalr-lib:4.2'
metadata-extractor = 'com.drewnoakes:metadata-extractor:2.19.0'
[bundles]
lucene = ['lucene-core', 'lucene-queryparser', 'lucene-highlighter', 'lucene-backward-codecs', 'lucene-analyzers-common']
resilience4j = ['resilience4j-springboot3', 'resilience4j-reactor']
apache = ['apache-commons-lang3', 'apache-tika-core']
therapi = ['therapi-runtime-javadoc', 'therapi-runtime-javadoc-scribe']
[plugins]
spring-boot = 'org.springframework.boot:3.4.5'
spring-dependency-management = 'io.spring.dependency-management:1.1.7'
git-properties = 'com.gorylenko.gradle-git-properties:2.4.1'
undercouch-download = 'de.undercouch.download:5.6.0'
lombok = 'io.freefair.lombok:8.13'
checksum = 'org.gradle.crypto.checksum:1.4.0'
node = 'com.github.node-gradle.node:7.1.0'
openapi-generator = 'org.openapi.generator:7.12.0'
springdoc-openapi = 'org.springdoc.openapi-gradle-plugin:1.9.0'
versions = 'com.github.ben-manes.versions:0.52.0'

View File

@ -1,33 +1,14 @@
import org.springframework.boot.gradle.plugin.SpringBootPlugin import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins { plugins {
id 'org.springframework.boot' apply false
id 'java-platform' id 'java-platform'
id 'halo.publish' id 'halo.publish'
alias(libs.plugins.spring.boot) apply false
} }
group = 'run.halo.tools.platform' group = 'run.halo.tools.platform'
description = 'Platform of application.' description = 'Platform of application.'
ext {
commonsLang3 = "3.12.0"
base62 = "0.1.3"
pf4j = '3.13.0'
javaDiffUtils = "4.12"
guava = "33.3.1-jre"
jsoup = '1.18.1'
jsonPatch = "1.13"
springDocOpenAPI = "2.8.3"
lucene = "9.12.0"
resilience4jVersion = "2.2.0"
twoFactorAuth = "1.3"
tika = "2.9.2"
imgscalr = '4.2'
exifExtractor = '2.19.0'
therapiVersion = '0.13.0'
bouncycastleVersion = '1.80'
}
javaPlatform { javaPlatform {
allowDependencies() allowDependencies()
} }
@ -36,34 +17,24 @@ dependencies {
api platform(SpringBootPlugin.BOM_COORDINATES) api platform(SpringBootPlugin.BOM_COORDINATES)
constraints { constraints {
api "org.springdoc:springdoc-openapi-starter-webflux-ui:$springDocOpenAPI" api libs.bundles.lucene
api 'org.openapi4j:openapi-schema-validator:1.0.7' api libs.bundles.apache
api "org.bouncycastle:bcpkix-jdk18on:$bouncycastleVersion" api libs.bundles.therapi
api libs.springdoc.openapi
// Apache Lucene api libs.openapi.schema.validator
api "org.apache.lucene:lucene-core:$lucene" api libs.bouncycastle.bcpkix
api "org.apache.lucene:lucene-queryparser:$lucene" api libs.encoding.base62
api "org.apache.lucene:lucene-highlighter:$lucene" api libs.pf4j
api "org.apache.lucene:lucene-backward-codecs:$lucene" api libs.guava
api "org.apache.lucene:lucene-analysis-common:$lucene" api libs.java.diff.utils
api libs.jsoup
api "org.apache.commons:commons-lang3:$commonsLang3" api libs.json.patch
api "io.seruco.encoding:base62:$base62" api libs.bundles.resilience4j
api "org.pf4j:pf4j:$pf4j" api libs.twofactor.auth
api "com.google.guava:guava:$guava" api libs.imgscalr.lib
api "org.jsoup:jsoup:$jsoup" api libs.metadata.extractor
api "io.github.java-diff-utils:java-diff-utils:$javaDiffUtils"
api "org.springframework.integration:spring-integration-core" api "org.springframework.integration:spring-integration-core"
api "com.github.java-json-tools:json-patch:$jsonPatch"
api "org.thymeleaf.extras:thymeleaf-extras-springsecurity6" api "org.thymeleaf.extras:thymeleaf-extras-springsecurity6"
api "io.github.resilience4j:resilience4j-spring-boot3:$resilience4jVersion"
api "io.github.resilience4j:resilience4j-reactor:$resilience4jVersion"
api "com.j256.two-factor-auth:two-factor-auth:$twoFactorAuth"
api "org.apache.tika:tika-core:$tika"
api "org.imgscalr:imgscalr-lib:$imgscalr"
api "com.drewnoakes:metadata-extractor:$exifExtractor"
api "com.github.therapi:therapi-runtime-javadoc:$therapiVersion"
api "com.github.therapi:therapi-runtime-javadoc-scribe:$therapiVersion"
} }
} }

View File

@ -1,7 +1,7 @@
plugins { plugins {
id 'idea' id 'idea'
id 'com.github.node-gradle.node' alias(libs.plugins.node)
id 'org.openapi.generator' version '7.6.0' alias(libs.plugins.openapi.generator)
} }
idea { idea {