File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change
1
+ import kotlinx.validation.build.addPublishingRepositoryIfPresent
1
2
import kotlinx.kover.gradle.plugin.dsl.CoverageUnit
2
3
import kotlinx.validation.build.mavenCentralMetadata
3
- import kotlinx.validation.build.mavenRepositoryPublishing
4
4
import kotlinx.validation.build.signPublicationIfKeyPresent
5
5
import org.gradle.api.attributes.TestSuiteType.FUNCTIONAL_TEST
6
6
import org.jetbrains.dokka.gradle.DokkaTask
@@ -125,8 +125,8 @@ publishing {
125
125
create<MavenPublication >(" maven" ) {
126
126
from(components[" java" ])
127
127
}
128
+ addPublishingRepositoryIfPresent(project)
128
129
129
- mavenRepositoryPublishing(project)
130
130
mavenCentralMetadata()
131
131
}
132
132
Original file line number Diff line number Diff line change @@ -11,13 +11,18 @@ import org.gradle.api.publish.maven.*
11
11
import org.gradle.plugins.signing.*
12
12
import java.net.*
13
13
14
- fun PublishingExtension.mavenRepositoryPublishing (project : Project ) {
15
- repositories {
16
- maven {
17
- url = URI (" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
18
- credentials {
19
- username = project.getSensitiveProperty(" libs.sonatype.user" )
20
- password = project.getSensitiveProperty(" libs.sonatype.password" )
14
+ // Artifacts are published to an intermediate repo (libs.repo.url) first,
15
+ // and then deployed to the central portal.
16
+ fun PublishingExtension.addPublishingRepositoryIfPresent (project : Project ) {
17
+ val repositoryUrl = project.getSensitiveProperty(" libs.repo.url" )
18
+ if (! repositoryUrl.isNullOrBlank()) {
19
+ repositories {
20
+ maven {
21
+ url = URI (repositoryUrl)
22
+ credentials {
23
+ username = project.getSensitiveProperty(" libs.repo.user" )
24
+ password = project.getSensitiveProperty(" libs.repo.password" )
25
+ }
21
26
}
22
27
}
23
28
}
You can’t perform that action at this time.
0 commit comments