@@ -61,10 +61,10 @@ public class PluginBuildPlugin extends BuildPlugin {
61
61
// and generate a different pom for the zip
62
62
addClientJarPomGeneration(project)
63
63
addClientJarTask(project)
64
- } else {
65
- // no client plugin, so use the pom file from nebula, without jar, for the zip
66
- project. ext. set(" nebulaPublish.maven.jar" , false )
67
64
}
65
+ // while the jar isn't normally published, we still at least build a pom of deps
66
+ // in case it is published, for instance when other plugins extend this plugin
67
+ configureJarPom(project)
68
68
69
69
project. integTestCluster. dependsOn(project. bundlePlugin)
70
70
project. tasks. run. dependsOn(project. bundlePlugin)
@@ -78,7 +78,6 @@ public class PluginBuildPlugin extends BuildPlugin {
78
78
}
79
79
80
80
if (isModule == false || isXPackModule) {
81
- addZipPomGeneration(project)
82
81
addNoticeGeneration(project)
83
82
}
84
83
@@ -221,36 +220,15 @@ public class PluginBuildPlugin extends BuildPlugin {
221
220
}
222
221
}
223
222
224
- /* * Adds a task to generate a pom file for the zip distribution. */
225
- public static void addZipPomGeneration (Project project ) {
223
+ /* * Configure the pom for the main jar of this plugin */
224
+ protected static void configureJarPom (Project project ) {
226
225
project. plugins. apply(ScmInfoPlugin . class)
227
226
project. plugins. apply(MavenPublishPlugin . class)
228
227
229
228
project. publishing {
230
229
publications {
231
- zip(MavenPublication ) {
232
- artifact project. bundlePlugin
233
- }
234
- /* HUGE HACK: the underlying maven publication library refuses to deploy any attached artifacts
235
- * when the packaging type is set to 'pom'. But Sonatype's OSS repositories require source files
236
- * for artifacts that are of type 'zip'. We already publish the source and javadoc for Elasticsearch
237
- * under the various other subprojects. So here we create another publication using the same
238
- * name that has the "real" pom, and rely on the fact that gradle will execute the publish tasks
239
- * in alphabetical order. This lets us publish the zip file and even though the pom says the
240
- * type is 'pom' instead of 'zip'. We cannot setup a dependency between the tasks because the
241
- * publishing tasks are created *extremely* late in the configuration phase, so that we cannot get
242
- * ahold of the actual task. Furthermore, this entire hack only exists so we can make publishing to
243
- * maven local work, since we publish to maven central externally. */
244
- zipReal(MavenPublication ) {
245
- artifactId = project. pluginProperties. extension. name
246
- pom. withXml { XmlProvider xml ->
247
- Node root = xml. asNode()
248
- root. appendNode(' name' , project. pluginProperties. extension. name)
249
- root. appendNode(' description' , project. pluginProperties. extension. description)
250
- root. appendNode(' url' , urlFromOrigin(project. scminfo. origin))
251
- Node scmNode = root. appendNode(' scm' )
252
- scmNode. appendNode(' url' , project. scminfo. origin)
253
- }
230
+ nebula(MavenPublication ) {
231
+ artifactId project. pluginProperties. extension. name
254
232
}
255
233
}
256
234
}
0 commit comments