File tree Expand file tree Collapse file tree 1 file changed +9
-28
lines changed
build-logic/src/main/kotlin/kotlinx/io/conventions Expand file tree Collapse file tree 1 file changed +9
-28
lines changed Original file line number Diff line number Diff line change @@ -55,35 +55,16 @@ fun MavenPom.configureMavenCentralMetadata(project: Project) {
55
55
}
56
56
}
57
57
58
- fun MavenPublication.mavenCentralArtifacts (project : Project , sources : SourceDirectorySet ) {
59
- val sourcesJar by project.tasks.creating(Jar ::class ) {
60
- archiveClassifier = " sources"
61
- from(sources)
62
- }
63
- val javadocJar by project.tasks.creating(Jar ::class ) {
64
- archiveClassifier = " javadoc"
65
- // contents are deliberately left empty
66
- }
67
- artifact(sourcesJar)
68
- artifact(javadocJar)
69
- }
70
58
71
-
72
- fun mavenRepositoryUri (): URI {
73
- val repositoryId: String? = System .getenv(" libs.repository.id" )
74
- return if (repositoryId == null ) {
75
- URI (" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
76
- } else {
77
- URI (" https://oss.sonatype.org/service/local/staging/deployByRepositoryId/$repositoryId " )
78
- }
79
- }
80
-
81
- fun RepositoryHandler.configureMavenPublication ( project : Project ) {
82
- maven {
83
- url = mavenRepositoryUri()
84
- credentials {
85
- username = project.getSensitiveProperty(" libs.sonatype.user" )
86
- password = project.getSensitiveProperty(" libs.sonatype.password" )
59
+ fun RepositoryHandler.configureMavenPublication (project : Project ) {
60
+ val repositoryUrl = project.getSensitiveProperty(" libs.repo.url" )
61
+ if (! repositoryUrl.isNullOrBlank()) {
62
+ maven {
63
+ url = uri(repositoryUrl)
64
+ credentials {
65
+ username = project.getSensitiveProperty(" libs.repo.user" )
66
+ password = project.getSensitiveProperty(" libs.repo.password" )
67
+ }
87
68
}
88
69
}
89
70
You can’t perform that action at this time.
0 commit comments