Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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")
}
}
}
}
Expand All @@ -60,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 {
Expand Down