From 4a6ee2b0439457d5ae446a5c2ab9e60773e78ac4 Mon Sep 17 00:00:00 2001 From: German Osin Date: Wed, 15 Jan 2025 14:54:53 +0100 Subject: [PATCH] Plugins varion catalog --- api/build.gradle | 11 ++++++----- contract/build.gradle | 2 +- e2e-tests/build.gradle | 4 ++-- gradle.properties | 2 +- gradle/libs.versions.toml | 7 +++++++ serde-api/build.gradle | 30 ++++++++++++++---------------- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/api/build.gradle b/api/build.gradle index 3def81ec6..15b47a016 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -2,15 +2,16 @@ plugins { id 'antlr' id 'checkstyle' - id 'org.springframework.boot' version '3.4.1' - id 'com.gorylenko.gradle-git-properties' version "2.4.2" + alias(libs.plugins.spring.boot) + alias(libs.plugins.git.properties) } dependencies { implementation project(":contract") - implementation project(":frontend") + if (prod) { + implementation project(":frontend") + } implementation project(":serde-api") - implementation libs.spring.starter.webflux implementation libs.spring.starter.security implementation libs.spring.starter.actuator @@ -104,7 +105,7 @@ tasks.withType(Checkstyle) { checkstyle { toolVersion '10.3.1' - configFile = rootProject.file('etc/checkstyle/checkstyle-e2e.xml') + configFile = rootProject.file('etc/checkstyle/checkstyle.xml') ignoreFailures = false maxWarnings = 0 maxErrors = 0 diff --git a/contract/build.gradle b/contract/build.gradle index ad6e23110..9d8ec8bda 100644 --- a/contract/build.gradle +++ b/contract/build.gradle @@ -2,7 +2,7 @@ import org.openapitools.generator.gradle.plugin.tasks.GenerateTask plugins { id "java-library" - id 'org.openapi.generator' version '7.9.0' + alias(libs.plugins.openapi.generator) } diff --git a/e2e-tests/build.gradle b/e2e-tests/build.gradle index 4b44e97fa..739368097 100644 --- a/e2e-tests/build.gradle +++ b/e2e-tests/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'checkstyle' - id 'io.qameta.allure' version '2.10.0' + alias(libs.plugins.allure) } ext { @@ -31,7 +31,7 @@ dependencies { checkstyle { toolVersion '10.3.1' - configFile = rootProject.file('etc/checkstyle/checkstyle.xml') + configFile = rootProject.file('etc/checkstyle/checkstyle-e2e.xml') ignoreFailures = false maxWarnings = 10 maxErrors = 0 diff --git a/gradle.properties b/gradle.properties index 6118f4e51..f5d657382 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -description='Kafka UI' +description='Kafbat UI' version=0.1.0-SNAPSHOT group=io.kafbat.ui local_node = false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 44d319ce4..dcbbcc10a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -38,6 +38,13 @@ micrometer = '1.13.8' antlr = '4.12.0' json-schema-validator = '2.2.14' +[plugins] +spring-boot = { id = 'org.springframework.boot', version = '3.4.1' } +git-properties = { id = 'com.gorylenko.gradle-git-properties', version = '2.4.2' } +openapi-generator = { id = 'org.openapi.generator', version = '7.9.0' } +allure = { id = 'io.qameta.allure', version='2.10.0' } +nexus-publish-plugin = { id = 'io.github.gradle-nexus.publish-plugin', version = '1.1.0'} + [libraries] spring-starter-actuator = { module = 'org.springframework.boot:spring-boot-starter-actuator', version.ref = 'spring-boot' } diff --git a/serde-api/build.gradle b/serde-api/build.gradle index f02bb3632..cdf1f6937 100644 --- a/serde-api/build.gradle +++ b/serde-api/build.gradle @@ -2,11 +2,7 @@ plugins { id 'java-library' id 'signing' id 'maven-publish' -// id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' -} - -ext { - env = findProperty('env') ?: 'dev' + alias(libs.plugins.nexus.publish.plugin) } tasks.register('sourceJar', Jar) { @@ -89,14 +85,16 @@ publishing { } } -//nexusPublishing { -// repositories { -// sonatype { -// nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") -// snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") -// -// username = sonatypeUsername -// password = sonatypePassword -// } -// } -//} +if (prod) { + nexusPublishing { + repositories { + sonatype { + nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") + snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") + + username = sonatypeUsername + password = sonatypePassword + } + } + } +}