forked from grails/grails-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
30 lines (27 loc) · 1.35 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
plugins {
id "io.github.gradle-nexus.publish-plugin"
id "org.grails.forge.internal.aggregator"
}
version project.projectVersion
group "org.grails.forge"
def ossUser = System.getenv("SONATYPE_USERNAME") ?: rootProject.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: rootProject.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
if (!ossUser.isEmpty() && !ossPass.isEmpty()) {
String version = String.valueOf(rootProject.getVersion());
if ("unspecified".equals(version)) {
throw new RuntimeException("The root project doesn't define a version. Please set the version in the root project.");
}
nexusPublishing {
repositories {
sonatype {
allowInsecureProtocol = rootProject.hasProperty("allowInsecurePublishing")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}
}
}