@@ -16,6 +16,7 @@ apply plugin: 'kotlin'
16
16
apply plugin : ' org.jetbrains.kotlin.jvm'
17
17
apply plugin : ' org.jetbrains.kotlin.plugin.allopen'
18
18
apply plugin : ' idea'
19
+ apply plugin : ' maven-publish'
19
20
20
21
ext {
21
22
projectSubstitutions = [:]
@@ -83,6 +84,11 @@ tasks.register("sourcesJar", Jar) {
83
84
from sourceSets. main. allSource
84
85
}
85
86
87
+ task javadocJar (type : Jar ) {
88
+ archiveClassifier = ' javadoc'
89
+ from javadoc. destinationDir
90
+ }
91
+
86
92
test {
87
93
doFirst {
88
94
test. classpath - = project. files(project. tasks. named(' shadowJar' ))
@@ -103,3 +109,55 @@ check.dependsOn integTest
103
109
testClusters. javaRestTest {
104
110
testDistribution = ' INTEG_TEST'
105
111
}
112
+
113
+ publishing {
114
+ repositories {
115
+ maven {
116
+ name = ' staging'
117
+ url = " ${ rootProject.buildDir} /local-staging-repo"
118
+ }
119
+ maven {
120
+ name = " Snapshots"
121
+ url = " https://aws.oss.sonatype.org/content/repositories/snapshots"
122
+ credentials {
123
+ username " $System . env . SONATYPE_USERNAME "
124
+ password " $System . env . SONATYPE_PASSWORD "
125
+ }
126
+ }
127
+ }
128
+ publications {
129
+ shadow(MavenPublication ) {
130
+ project. shadow. component(it)
131
+
132
+ artifact sourcesJar
133
+ artifact javadocJar
134
+
135
+ pom {
136
+ name = " OpenSearch Index Management SPI"
137
+ packaging = " jar"
138
+ url = " https://github.com/opensearch-project/index-management"
139
+ description = " OpenSearch Index Management SPI"
140
+ scm {
141
+ connection
= " scm:[email protected] :opensearch-project/index-management.git"
142
+ developerConnection
= " scm:[email protected] :opensearch-project/index-management.git"
143
+ url
= " [email protected] :opensearch-project/index-management.git"
144
+ }
145
+ licenses {
146
+ license {
147
+ name = " The Apache License, Version 2.0"
148
+ url = " http://www.apache.org/licenses/LICENSE-2.0.txt"
149
+ }
150
+ }
151
+ developers {
152
+ developer {
153
+ name = " OpenSearch"
154
+ url = " https://github.com/opensearch-project/index-management"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+
161
+ gradle. startParameter. setShowStacktrace(ShowStacktrace . ALWAYS )
162
+ gradle. startParameter. setLogLevel(LogLevel . DEBUG )
163
+ }
0 commit comments