Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit ff4f3a8

Browse files
committed
Prepare sonatype bundles to avoid odd problems with split staging repositories.
1 parent 746b501 commit ff4f3a8

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

build.gradle

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,17 @@ configure(rootProject) {
119119
apply plugin: 'maven-publish'
120120
apply plugin: 'signing'
121121

122+
ext {
123+
mavenBuildRepo = file("${buildDir}/maven")
124+
}
125+
122126
publishing {
123127
repositories {
128+
maven {
129+
name = 'build'
130+
url = mavenBuildRepo
131+
}
132+
124133
maven {
125134
name = 'sonatype'
126135
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
@@ -174,12 +183,14 @@ configure(rootProject) {
174183
175184
}
176185
}
186+
// Added automatically by ES plugin.
187+
/*
177188
scm {
178189
connection = 'scm:git:https://github.com/carrot2/elasticsearch-carrot2'
179190
developerConnection = 'scm:git:[email protected]:carrot2/elasticsearch-carrot2.git'
180-
// Added automatically by ES plugin.
181191
// url = 'https://github.com/carrot2/elasticsearch-carrot2'
182192
}
193+
*/
183194
}
184195
}
185196
}
@@ -192,4 +203,31 @@ configure(rootProject) {
192203
task publishToSonatype() {
193204
dependsOn publishMavenPublicationToSonatypeRepository
194205
}
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+
}
195233
}

0 commit comments

Comments
 (0)