File tree Expand file tree Collapse file tree 1 file changed +22
-15
lines changed Expand file tree Collapse file tree 1 file changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -165,23 +165,30 @@ publishing {
165
165
}
166
166
}
167
167
repositories {
168
- // To locally check out the poms
169
- maven {
170
- name = " BuildDir"
171
- url = uri(" $buildDir /repos/snapshots" )
172
- }
173
- // Snapshots are published to Sonatype's repository directly
174
- maven {
175
- name = " SonatypeOSS"
176
- url = uri(" https://oss.sonatype.org/content/repositories/snapshots/" )
177
- credentials {
178
- val ossrhUsername: String by project
179
- val ossrhPassword: String by project
180
- username = ossrhUsername
181
- password = ossrhPassword
182
- }
168
+ // To locally check out the poms
169
+ maven {
170
+ val releasesRepoUrl = uri(" $buildDir /repos/releases" )
171
+ val snapshotsRepoUrl = uri(" $buildDir /repos/snapshots" )
172
+ name = " BuildDir"
173
+ url = if (project.extra[" isReleaseVersion" ] as Boolean ) releasesRepoUrl else snapshotsRepoUrl
174
+ }
175
+ maven {
176
+ val releasesRepoUrl = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
177
+ val snapshotsRepoUrl = uri(" https://oss.sonatype.org/content/repositories/snapshots/" )
178
+ name = " SonatypeOSS"
179
+ url = if (project.extra[" isReleaseVersion" ] as Boolean ) releasesRepoUrl else snapshotsRepoUrl
180
+ credentials {
181
+ val ossrhUsername: String by project
182
+ val ossrhPassword: String by project
183
+ username = ossrhUsername
184
+ password = ossrhPassword
183
185
}
186
+ }
184
187
}
185
188
}
186
189
}
187
190
}
191
+
192
+ signing {
193
+ sign(publishing.publications[" mavenJava" ])
194
+ }
You can’t perform that action at this time.
0 commit comments