@@ -119,8 +119,17 @@ configure(rootProject) {
119
119
apply plugin : ' maven-publish'
120
120
apply plugin : ' signing'
121
121
122
+ ext {
123
+ mavenBuildRepo = file(" ${ buildDir} /maven" )
124
+ }
125
+
122
126
publishing {
123
127
repositories {
128
+ maven {
129
+ name = ' build'
130
+ url = mavenBuildRepo
131
+ }
132
+
124
133
maven {
125
134
name = ' sonatype'
126
135
url " https://oss.sonatype.org/service/local/staging/deploy/maven2"
@@ -174,12 +183,14 @@ configure(rootProject) {
174
183
175
184
}
176
185
}
186
+ // Added automatically by ES plugin.
187
+ /*
177
188
scm {
178
189
connection = 'scm:git:https://github.com/carrot2/elasticsearch-carrot2'
179
190
developerConnection = 'scm:git:[email protected] :carrot2/elasticsearch-carrot2.git'
180
- // Added automatically by ES plugin.
181
191
// url = 'https://github.com/carrot2/elasticsearch-carrot2'
182
192
}
193
+ */
183
194
}
184
195
}
185
196
}
@@ -192,4 +203,31 @@ configure(rootProject) {
192
203
task publishToSonatype() {
193
204
dependsOn publishMavenPublicationToSonatypeRepository
194
205
}
206
+
207
+ tasks. matching { it. path == " :publishMavenPublicationToBuildRepository" }. all {
208
+ doFirst {
209
+ delete mavenBuildRepo
210
+ }
211
+ }
212
+
213
+ task publishToLocal() {
214
+ group " Publishing"
215
+ description " Publish Maven artifacts locally to " + file(mavenBuildRepo)
216
+
217
+ dependsOn " :publishMavenPublicationToBuildRepository"
218
+ }
219
+
220
+ task sonatypeBundle(type : Zip ) {
221
+ group " Publishing"
222
+ description " Prepare a sonatype bundle archive with all artifacts."
223
+
224
+ dependsOn publishToLocal
225
+
226
+ archiveFileName = " bundle-${ project.archivesBaseName} -${ project.version} .zip"
227
+ destinationDirectory = file(" ${ buildDir} /sonatype" )
228
+
229
+ from(mavenBuildRepo, {
230
+ exclude " **/maven-metadata*"
231
+ })
232
+ }
195
233
}
0 commit comments