1+ import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven
12import org.jetbrains.dokka.gradle.DokkaTaskPartial
23import org.jetbrains.dokka.gradle.tasks.DokkaGeneratePublicationTask
34import org.jetbrains.kotlin.gradle.dsl.JvmTarget
@@ -24,8 +25,54 @@ repositories {
2425}
2526
2627mavenPublishing {
27- publishToMavenCentral()
28+ // Central Portal 사용 (OSSRH가 아닌)
29+ publishToMavenCentral(automaticRelease = false )
30+
31+ // GPG 서명 활성화 (선택사항이지만 권장)
2832 signAllPublications()
33+
34+ // 아티팩트 좌표 및 POM 메타데이터 설정
35+ coordinates(group.toString(), " sdk" , version.toString())
36+
37+ pom {
38+ name.set(" SOLAPI SDK" )
39+ description.set(" SOLAPI 및 SOLAPI 계열(쿨에스엠에스 등) 서비스에서 사용되는 문자 발송용 SDK" )
40+ url.set(" https://github.com/solapi/solapi-kotlin" )
41+
42+ licenses {
43+ license {
44+ name.set(" MIT License" )
45+ url.set(" https://opensource.org/license/MIT" )
46+ }
47+ }
48+
49+ developers {
50+ developer {
51+ id.set(" contact" )
52+ name.set(" SOLAPI Contact" )
53+ email.set(" contact@solapi.com" )
54+ organization.set(" SOLAPI Inc" )
55+ }
56+ developer {
57+ id.set(" lucy" )
58+ name.set(" Lucy Lee" )
59+ email.set(" lucy@solapi.com" )
60+ organization.set(" SOLAPI Inc" )
61+ }
62+ developer {
63+ id.set(" hosy" )
64+ name.set(" Hosy Lee" )
65+ email.set(" hosy@solapi.com" )
66+ organization.set(" SOLAPI Inc" )
67+ }
68+ }
69+
70+ scm {
71+ connection.set(" scm:git:git://github.com/solapi/solapi-kotlin.git" )
72+ developerConnection.set(" scm:git:ssh://github.com/solapi/solapi-kotlin.git" )
73+ url.set(" https://github.com/solapi/solapi-kotlin" )
74+ }
75+ }
2976}
3077
3178dependencies {
@@ -67,7 +114,7 @@ tasks.withType<KotlinCompile>().configureEach {
67114}
68115
69116java {
70- withJavadocJar()
117+ // Dokka가 javadocJar를 제공하므로 withJavadocJar() 제거
71118 withSourcesJar()
72119}
73120
@@ -122,54 +169,12 @@ tasks.withType<DokkaGeneratePublicationTask>().configureEach {
122169 outputDirectory.set(project.rootDir.resolve(" docs" ))
123170}
124171
125- publishing {
126- publications {
127- create<MavenPublication >(" mavenJava" ) {
128- groupId = group.toString()
129- artifactId = " sdk"
130- version = version
131-
132- from(components[" shadow" ])
133-
134- artifact(tasks.named(" sourcesJar" ))
135- artifact(tasks.named(" javadocJar" ))
136-
137- pom {
138- name.set(" SOLAPI SDK" )
139- description.set(" SOLAPI 및 SOLAPI 계열(쿨에스엠에스 등) 서비스에서 사용되는 문자 발송용 SDK" )
140- url.set(" https://github.com/nurigo/java-sdk" )
141- licenses {
142- license {
143- name.set(" MIT License" )
144- url.set(" https://opensource.org/license/MIT" )
145- }
146- }
147- developers {
148- developer {
149- name.set(" SOLAPI Contact" )
150- email.set(" contact@SOLAPI.com" )
151- organization.set(" SOLAPI Inc" )
152- }
153- developer {
154- name.set(" Lucy Lee" )
155- email.set(" lucy@solapi.com" )
156- organization.set(" SOLAPI Inc" )
157- }
158- developer {
159- id.set(" hosy" )
160- name.set(" Hosy Lee" )
161- email.set(" hosy@solapi.com" )
162- organization.set(" SOLAPI Inc" )
163- }
164- }
165- scm {
166- connection.set(" scm:git:git://github.com/solapi/solapi-kotlin.git" )
167- developerConnection.set(" scm:git:ssh://github.com/solapi/solapi-kotlin.git" )
168- url.set(" https://github.com/solapi/solapi-kotlin" )
169- }
170- }
171- }
172- }
172+ // Publishing 관련 태스크들이 dokkaJavadocJar에 의존하도록 설정
173+ tasks.withType<AbstractPublishToMaven >().configureEach {
174+ dependsOn(" dokkaJavadocJar" )
173175}
174176
175-
177+ // 메타데이터 생성 태스크가 dokkaJavadocJar에 의존하도록 설정
178+ afterEvaluate {
179+ tasks.findByName(" generateMetadataFileForMavenPublication" )?.dependsOn(" dokkaJavadocJar" )
180+ }
0 commit comments