Skip to content

Commit 6dd81ea

Browse files
authored
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 8f886cd commit 6dd81ea

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

build.gradle

+14
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,23 @@ subprojects {
5353
description = "Elasticsearch subproject ${project.path}"
5454
}
5555

56+
apply plugin: 'nebula.info-scm'
57+
String licenseCommit
58+
if (VersionProperties.elasticsearch.toString().endsWith('-SNAPSHOT')) {
59+
licenseCommit = scminfo.change ?: "master" // leniency for non git builds
60+
} else {
61+
licenseCommit = "v${version}"
62+
}
63+
String elasticLicenseUrl = "https://raw.githubusercontent.com/elastic/elasticsearch/${licenseCommit}/licenses/ELASTIC-LICENSE.txt"
64+
5665
subprojects {
66+
// Default to the apache license
5767
project.ext.licenseName = 'The Apache Software License, Version 2.0'
5868
project.ext.licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
69+
70+
// But stick the Elastic license url in project.ext so we can get it if we need to switch to it
71+
project.ext.elasticLicenseUrl = elasticLicenseUrl
72+
5973
// we only use maven publish to add tasks for pom generation
6074
plugins.withType(MavenPublishPlugin).whenPluginAdded {
6175
publishing {

distribution/archives/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ subprojects {
228228
check.dependsOn checkNotice
229229

230230
if (project.name == 'zip' || project.name == 'tar') {
231+
project.ext.licenseName = 'Elastic License'
232+
project.ext.licenseUrl = ext.elasticLicenseUrl
231233
task checkMlCppNotice {
232234
dependsOn buildDist, checkExtraction
233235
onlyIf toolExists

x-pack/build.gradle

+1-9
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
project.ext.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt')
2719
project.ext.noticeFile = xpackRootProject.file('NOTICE.txt')

0 commit comments

Comments
 (0)