Skip to content

Commit

Permalink
chore(version catalog): convert a few libs (#3038)
Browse files Browse the repository at this point in the history
* chore(version catalog): convert quartz
* chore(version catalog): convert micrometer
* chore(version catalog): convert jdbc drivers
  • Loading branch information
educhastenier authored Jun 18, 2024
1 parent a6357f6 commit bc87509
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 67 deletions.
8 changes: 5 additions & 3 deletions bonita-engine-standalone/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ dependencies {
testImplementation "org.assertj:assertj-core:${Deps.assertjVersion}"
testImplementation "junit:junit:${Deps.junit4Version}"
testImplementation "com.github.stefanbirkner:system-rules:${Deps.systemRulesVersion}"
testImplementation "org.postgresql:postgresql:${Deps.postgresqlVersion}"
testImplementation "com.mysql:mysql-connector-j:${Deps.mysqlVersion}"
testImplementation libs.h2

// These 3 drivers are used for some specific tests:
testImplementation(libs.postgresql)
testImplementation(libs.mysql)
testImplementation(libs.h2)

}

Expand Down
4 changes: 2 additions & 2 deletions bonita-engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ dependencyManagement {
dependency libs.tomcatDbcp.get() as String
dependency "org.jboss.narayana.jta:narayana-jta:${Deps.narayanaVersion}"
dependency libs.jakartaActivation.get() as String
dependency("org.quartz-scheduler:quartz:${Deps.quartzVersion}")
dependency(libs.quartz.get() as String)
dependency(libs.eclipseCompiler.get() as String)
dependency("javax.annotation:javax.annotation-api:$Deps.javaxAnnotationsVersion")
dependencySet(group: "io.micrometer", version: Deps.micrometerVersion) {
dependencySet(group: "io.micrometer", version: libs.versions.micrometerVersion.get()) {
entry "micrometer-core"
entry "micrometer-registry-jmx"
entry "micrometer-registry-prometheus"
Expand Down
3 changes: 0 additions & 3 deletions bonita-integration-tests/benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ dependencies {
api "org.mockito:mockito-core:${Deps.mockitoVersion}"
api project(':bonita-integration-tests:bonita-integration-tests-client')
api project(':bpm:bonita-server')
runtimeOnly "com.mysql:mysql-connector-j:${Deps.mysqlVersion}"
runtimeOnly "com.microsoft.sqlserver:mssql-jdbc:${Deps.mssqlVersion}"
runtimeOnly "org.postgresql:postgresql:${Deps.postgresqlVersion}"
testRuntimeOnly "ch.qos.logback:logback-classic:${Deps.logbackVersion}"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ dependencies {
implementation(project(":bpm:bonita-core:bonita-process-engine"))
api project(':bpm:bonita-server')
api libs.commonsIO
runtimeOnly "com.mysql:mysql-connector-j:${Deps.mysqlVersion}"
runtimeOnly "com.microsoft.sqlserver:mssql-jdbc:${Deps.mssqlVersion}"
runtimeOnly "org.postgresql:postgresql:${Deps.postgresqlVersion}"
testRuntimeOnly "ch.qos.logback:logback-classic:${Deps.logbackVersion}"
testAnnotationProcessor libs.lombok
testImplementation libs.lombok
Expand Down
2 changes: 1 addition & 1 deletion bpm/bonita-core/bonita-process-engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
api libs.springSessionCore
api libs.springWeb
api libs.bundles.groovy
api "io.micrometer:micrometer-core:${Deps.micrometerVersion}"
api libs.micrometerCore

// Dependency on javax.annotations as it is not provided anymore in Java 11:
api("javax.annotation:javax.annotation-api:${Deps.javaxAnnotationsVersion}")
Expand Down
8 changes: 0 additions & 8 deletions buildSrc/src/main/groovy/Deps.groovy
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
class Deps {

public static String quartzVersion = "2.3.2"
public static String micrometerVersion = "1.6.1"

public static String mysqlVersion = "8.2.0"
public static String mssqlVersion = "8.4.1.jre8"
public static String oracleVersion = "19.3.0.0"
public static String postgresqlVersion = "42.4.4"

public static String narayanaVersion = "5.10.6.Final"
public static String jaxbVersion = "2.3.1"
public static String logbackVersion = "1.2.13"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package org.bonitasoft.engine.gradle.docker

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension

/**
* @author Emmanuel Duchastenier
*/
Expand All @@ -13,7 +15,17 @@ class DockerDatabasePlugin implements Plugin<Project> {
drivers
}

defineJdbcDriversConfiguration(project)
project.dependencies {
// the following jdbc drivers are available for integration tests
drivers(project.extensions.getByType(VersionCatalogsExtension.class).named("libs")
.findLibrary("mysql").get())
drivers(project.extensions.getByType(VersionCatalogsExtension.class).named("libs")
.findLibrary("oracle").get())
drivers(project.extensions.getByType(VersionCatalogsExtension.class).named("libs")
.findLibrary("postgresql").get())
drivers(project.extensions.getByType(VersionCatalogsExtension.class).named("libs")
.findLibrary("msSqlServer").get())
}

def databaseIntegrationTest = project.extensions.create("databaseIntegrationTest", DatabasePluginExtension)

Expand All @@ -26,13 +38,4 @@ class DockerDatabasePlugin implements Plugin<Project> {
}
}

def defineJdbcDriversConfiguration(Project project) {
project.dependencies {
// the following jdbc drivers are available for integration tests
drivers JdbcDriverDependencies.mysql
drivers JdbcDriverDependencies.oracle
drivers JdbcDriverDependencies.postgres
drivers JdbcDriverDependencies.sqlserver
}
}
}

This file was deleted.

16 changes: 15 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ xstreamVersion = "1.4.20"
ehCacheVersion = "2.10.10.12.7"
eclipseCompilerVersion = "3.38.0"
jakartaActivationVersion = "1.2.2"
quartzVersion = "2.3.2"
micrometerVersion = "1.6.1"
# DB drivers:
mysqlVersion = "8.2.0"
msSqlServerVersion = "8.4.1.jre8"
oracleVersion = "19.3.0.0"
postgresqlVersion = "42.4.4"

[libraries]
springCore = { module = "org.springframework:spring-core", version.ref = "springVersion" }
Expand Down Expand Up @@ -106,9 +113,16 @@ ehCache = { group = "net.sf.ehcache", name = "ehcache", version.ref = "ehCacheVe
eclipseCompiler = { group = "org.eclipse.jdt", name = "ecj", version.ref = "eclipseCompilerVersion" }
jakartaActivation = { group = "com.sun.activation", name = "jakarta.activation", version.ref = "jakartaActivationVersion" }


quartz = { group = "org.quartz-scheduler", name = "quartz", version.ref = "quartzVersion" }
micrometerCore = { group = "io.micrometer", name = "micrometer-core", version.ref = "micrometerVersion" }
micrometerRegistryJmx = { group = "io.micrometer", name = "micrometer-registry-jmx", version.ref = "micrometerVersion" }
micrometerRegistryPrometheus = { group = "io.micrometer", name = "micrometer-registry-prometheus", version.ref = "micrometerVersion" }

h2 = "com.h2database:h2:1.4.200"
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysqlVersion" }
msSqlServer = { group = "com.microsoft.sqlserver", name = "mssql-jdbc", version.ref = "msSqlServerVersion" }
oracle = { group = "com.oracle.database.jdbc", name = "ojdbc8", version.ref = "oracleVersion" }
postgresql = { group = "org.postgresql", name = "postgresql", version.ref = "postgresqlVersion" }

lombok = "org.projectlombok:lombok:1.18.32"

Expand Down
10 changes: 5 additions & 5 deletions platform/platform-setup/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ dependencies {
exclude(module: 'snakeyaml')
}
api libs.springBootStarterJdbc
api "org.postgresql:postgresql:${Deps.postgresqlVersion}"
api ("com.mysql:mysql-connector-j:${Deps.mysqlVersion}") {
api(libs.postgresql)
api(libs.mysql) {
exclude(module: 'protobuf-java')
}
api "com.microsoft.sqlserver:mssql-jdbc:${Deps.mssqlVersion}"
api libs.h2
api("com.oracle.database.jdbc:ojdbc8:${Deps.oracleVersion}") {
api libs.msSqlServer
api(libs.h2)
api(libs.oracle) {
exclude(module: "ons")
exclude(module: "oraclepki")
exclude(module: "osdt_cert")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ dependencies {
testImplementation libs.springJdbc
testImplementation testFixtures(project(':bpm:bonita-common'))
testRuntimeOnly libs.tomcatDbcp
testRuntimeOnly libs.h2
testRuntimeOnly "com.mysql:mysql-connector-j:${Deps.mysqlVersion}"
testRuntimeOnly "org.postgresql:postgresql:${Deps.postgresqlVersion}"
testRuntimeOnly "com.microsoft.sqlserver:mssql-jdbc:${Deps.mssqlVersion}"
testRuntimeOnly(libs.h2)

// Property Based Test framework:
testImplementation("com.pholser:junit-quickcheck-core:${Deps.junitQuickCheck}")
Expand Down
2 changes: 1 addition & 1 deletion services/bonita-commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
api libs.jakartaActivation
api libs.commonsLang
api(libs.xstream)
api "io.micrometer:micrometer-core:${Deps.micrometerVersion}"
api libs.micrometerCore
api libs.springContext
api libs.springBootAutoconfigure
api libs.slf4jApi
Expand Down
4 changes: 2 additions & 2 deletions services/bonita-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ dependencies {
api project(':services:bonita-commons')
api project(':services:bonita-transaction')
api project(':services:bonita-incident')
api("org.quartz-scheduler:quartz:${Deps.quartzVersion}") {
api(libs.quartz) {
exclude(group: "com.mchange") // c3p0 + transitive dep mchange-commons-java, because we do not use
// default Quartz connection provider, as we have our own
exclude(module: "HikariCP-java7") // Same reason
}
api "io.micrometer:micrometer-core:${Deps.micrometerVersion}"
api libs.micrometerCore
testImplementation "junit:junit:${Deps.junit4Version}"
testImplementation "org.assertj:assertj-core:${Deps.assertjVersion}"
testImplementation "org.mockito:mockito-core:${Deps.mockitoVersion}"
Expand Down

0 comments on commit bc87509

Please sign in to comment.