Skip to content

Commit ba1097a

Browse files
author
Kyle Dixler
authored
Fix gradle publishing (#158)
1 parent 0a8d119 commit ba1097a

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

provider/cmd/pulumi-resource-command/schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@
448448
"language": {
449449
"java": {
450450
"buildFiles": "gradle",
451+
"gradleNexusPublishPluginVersion": "1.1.0",
451452
"dependencies": {
452453
"com.pulumi:pulumi": "0.6.0",
453454
"com.google.code.gson:gson": "2.8.9",

sdk/java/build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
id("signing")
66
id("java-library")
77
id("maven-publish")
8+
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
89
}
910

1011
group = "com.pulumi"
@@ -16,7 +17,7 @@ def resolvedVersion = System.getenv("PACKAGE_VERSION") ?:
1617

1718
def signingKey = System.getenv("SIGNING_KEY")
1819
def signingPassword = System.getenv("SIGNING_PASSWORD")
19-
def publishRepoURL = System.getenv("PUBLISH_REPO_URL")
20+
def publishRepoURL = System.getenv("PUBLISH_REPO_URL") ?: "https://s01.oss.sonatype.org"
2021
def publishRepoUsername = System.getenv("PUBLISH_REPO_USERNAME")
2122
def publishRepoPassword = System.getenv("PUBLISH_REPO_PASSWORD")
2223

@@ -116,19 +117,6 @@ publishing {
116117
}
117118
}
118119
}
119-
120-
if (publishRepoURL) {
121-
repositories {
122-
maven {
123-
name = "PublishRepo"
124-
url = publishRepoURL
125-
credentials {
126-
username = publishRepoUsername
127-
password = publishRepoPassword
128-
}
129-
}
130-
}
131-
}
132120
}
133121

134122
javadoc {
@@ -138,6 +126,19 @@ javadoc {
138126
options.jFlags("-Xmx2g", "-Xms512m")
139127
}
140128

129+
if (publishRepoUsername) {
130+
nexusPublishing {
131+
repositories {
132+
sonatype {
133+
nexusUrl.set(uri(publishRepoURL + "/service/local/"))
134+
snapshotRepositoryUrl.set(uri(publishRepoURL + "/content/repositories/snapshots/"))
135+
username = publishRepoUsername
136+
password = publishRepoPassword
137+
}
138+
}
139+
}
140+
}
141+
141142
if (signingKey) {
142143
signing {
143144
useInMemoryPgpKeys(signingKey, signingPassword)

0 commit comments

Comments
 (0)