From 6ff57ff612027d1fb876d2221048e410379f2916 Mon Sep 17 00:00:00 2001 From: Patrik Korytar Date: Wed, 8 Jul 2026 15:27:18 +0200 Subject: [PATCH 1/2] Turn off artifact publishing for gradle >= 8 --- build.gradle | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 03438ebf..8bba5741 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,11 @@ plugins { id 'io.github.gradle-nexus.publish-plugin' version '1.0.0' } +// The Artifactory and nexus-publish plugins only work on Gradle 7 because APIs they +// use (project.convention, ConfigureUtil) are missing in newer Gradle versions; +// skip them on newer Gradle (needed for Mend) +def publishingEnabled = (gradle.gradleVersion.tokenize('.')[0] as int) < 8 + allprojects { repositories { mavenCentral() @@ -24,7 +29,9 @@ allprojects { apply plugin: 'maven-publish' - apply plugin: 'com.jfrog.artifactory' + if (publishingEnabled) { + apply plugin: 'com.jfrog.artifactory' + } group = 'org.jboss.pnc.artifactory-client' version = currentVersion @@ -35,23 +42,25 @@ allprojects { } } -artifactoryPublish.skip = true +if (publishingEnabled) { + artifactoryPublish.skip = true -artifactory { - publish { - defaults { - publications 'main' + artifactory { + publish { + defaults { + publications 'main' + } } } -} -nexusPublishing { - repositories { - sonatype { - nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) - snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") + nexusPublishing { + repositories { + sonatype { + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } } } } From 39acdd5de6e200552a6983c032fb572696023e7b Mon Sep 17 00:00:00 2001 From: Patrik Korytar Date: Wed, 8 Jul 2026 15:33:38 +0200 Subject: [PATCH 2/2] Fix Java version props to be compatible on both older and newer Gradle versions --- build.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8bba5741..fce533ff 100644 --- a/build.gradle +++ b/build.gradle @@ -69,8 +69,10 @@ subprojects { apply plugin: 'java-library' apply plugin: 'signing' - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } // Force secure versions to fix vulnerabilities configurations.all {