-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
55 lines (48 loc) · 2.14 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
}
}
ext.isSnapshot = project.projectVersion.endsWith("-SNAPSHOT")
ext.isReleaseVersion = !ext.isSnapshot
ext."signing.keyId" = System.getenv("SIGNING_KEY") ?: project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : null
ext."signing.password" = System.getenv("SIGNING_PASSPHRASE") ?: project.hasProperty("signing.password") ? project.getProperty('signing.password') : null
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : null
if (isReleaseVersion) {
apply plugin: "io.github.gradle-nexus.publish-plugin"
}
if (isReleaseVersion) {
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
}
allprojects {
apply plugin: "java"
java{
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.codehaus.groovy') {
details.useTarget(group: "org.apache.groovy", name: details.requested.name, version: groovyVersion)
details.because "The dependency coordinates are changed in Apache Groovy 4"
}
}
}
}