Skip to content

Commit d928cf4

Browse files
committed
Build: Fix the license in the pom zip and tar (#31336)
For 6.3 we renamed the `tar` and `zip` distributions to `oss-tar` and `oss-zip`. Then we added new `tar` and `zip` distributions that contain x-pack and are licensed under the Elastic License. Unfortunately we accidentally generated POM files along side the new `tar` and `zip` distributions that incorrectly claimed that they were Apache 2 licensed. Oooops. This fixes the license on the POMs generated for the `tar` and `zip` distributions.
1 parent 65455e0 commit d928cf4

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,23 @@ subprojects {
4141
description = "Elasticsearch subproject ${project.path}"
4242
}
4343

44+
apply plugin: 'nebula.info-scm'
45+
String licenseCommit
46+
if (VersionProperties.elasticsearch.toString().endsWith('-SNAPSHOT')) {
47+
licenseCommit = scminfo.change ?: "master" // leniency for non git builds
48+
} else {
49+
licenseCommit = "v${version}"
50+
}
51+
String elasticLicenseUrl = "https://raw.githubusercontent.com/elastic/elasticsearch/${licenseCommit}/licenses/ELASTIC-LICENSE.txt"
52+
4453
subprojects {
54+
// Default to the apache license
4555
project.ext.licenseName = 'The Apache Software License, Version 2.0'
4656
project.ext.licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
57+
58+
// But stick the Elastic license url in project.ext so we can get it if we need to switch to it
59+
project.ext.elasticLicenseUrl = elasticLicenseUrl
60+
4761
// we only use maven publish to add tasks for pom generation
4862
plugins.withType(MavenPublishPlugin).whenPluginAdded {
4963
publishing {

distribution/archives/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ subprojects {
220220
check.dependsOn checkNotice
221221

222222
if (project.name == 'zip' || project.name == 'tar') {
223+
project.ext.licenseName = 'Elastic License'
224+
project.ext.licenseUrl = ext.elasticLicenseUrl
223225
task checkMlCppNotice {
224226
dependsOn buildDist, checkExtraction
225227
onlyIf toolExists

x-pack/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ import org.elasticsearch.gradle.precommit.LicenseHeadersTask
55

66
Project xpackRootProject = project
77

8-
apply plugin: 'nebula.info-scm'
9-
final String licenseCommit
10-
if (version.endsWith('-SNAPSHOT')) {
11-
licenseCommit = xpackRootProject.scminfo.change ?: "master" // leniency for non git builds
12-
} else {
13-
licenseCommit = "v${version}"
14-
}
15-
168
subprojects {
179
group = 'org.elasticsearch.plugin'
1810
ext.xpackRootProject = xpackRootProject
@@ -21,7 +13,7 @@ subprojects {
2113
ext.xpackModule = { String moduleName -> xpackProject("plugin:${moduleName}").path }
2214

2315
ext.licenseName = 'Elastic License'
24-
ext.licenseUrl = "https://raw.githubusercontent.com/elastic/elasticsearch/${licenseCommit}/licenses/ELASTIC-LICENSE.txt"
16+
ext.licenseUrl = ext.elasticLicenseUrl
2517

2618
plugins.withType(BuildPlugin).whenPluginAdded {
2719
project.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt')

0 commit comments

Comments
 (0)