Skip to content

Commit

Permalink
Build: Fix the license in the pom zip and tar (#31336)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nik9000 committed Jun 14, 2018
1 parent 3e76b15 commit df17a83
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,23 @@ subprojects {
description = "Elasticsearch subproject ${project.path}"
}

apply plugin: 'nebula.info-scm'
String licenseCommit
if (VersionProperties.elasticsearch.toString().endsWith('-SNAPSHOT')) {
licenseCommit = scminfo.change ?: "master" // leniency for non git builds
} else {
licenseCommit = "v${version}"
}
String elasticLicenseUrl = "https://raw.githubusercontent.com/elastic/elasticsearch/${licenseCommit}/licenses/ELASTIC-LICENSE.txt"

subprojects {
// Default to the apache license
project.ext.licenseName = 'The Apache Software License, Version 2.0'
project.ext.licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'

// But stick the Elastic license url in project.ext so we can get it if we need to switch to it
project.ext.elasticLicenseUrl = elasticLicenseUrl

// we only use maven publish to add tasks for pom generation
plugins.withType(MavenPublishPlugin).whenPluginAdded {
publishing {
Expand Down
2 changes: 2 additions & 0 deletions distribution/archives/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ subprojects {
check.dependsOn checkNotice

if (project.name == 'zip' || project.name == 'tar') {
project.ext.licenseName = 'Elastic License'
project.ext.licenseUrl = ext.elasticLicenseUrl
task checkMlCppNotice {
dependsOn buildDist, checkExtraction
onlyIf toolExists
Expand Down
10 changes: 1 addition & 9 deletions x-pack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ import org.elasticsearch.gradle.precommit.LicenseHeadersTask

Project xpackRootProject = project

apply plugin: 'nebula.info-scm'
final String licenseCommit
if (version.endsWith('-SNAPSHOT')) {
licenseCommit = xpackRootProject.scminfo.change ?: "master" // leniency for non git builds
} else {
licenseCommit = "v${version}"
}

subprojects {
group = 'org.elasticsearch.plugin'
ext.xpackRootProject = xpackRootProject
Expand All @@ -21,7 +13,7 @@ subprojects {
ext.xpackModule = { String moduleName -> xpackProject("plugin:${moduleName}").path }

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

project.ext.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt')
project.ext.noticeFile = xpackRootProject.file('NOTICE.txt')
Expand Down

0 comments on commit df17a83

Please sign in to comment.