Build: Only add ASL license to pom for elasticsearch project (#22664)

The extra plugins that may be attached to the elasticsearch build
contain their own license. In the past, the ASL license elasticsearch
uses was avoided by specially checking for the gradle project prefix of
`:x-plugins`. However, since refactoring to the elasticsearch-extra dir
structure, this mechanism was broken. This change fixes the pom license
adding to only be applied to projects that fall under the root project
(ie elasticsearch).
This commit is contained in:
Ryan Ernst 2017-01-17 13:38:32 -08:00 committed by GitHub
parent ce811feba7
commit 621643a5c3
1 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@
* under the License.
*/
import java.nio.file.Path
import org.eclipse.jgit.lib.Repository
import org.eclipse.jgit.lib.RepositoryBuilder
import org.gradle.plugins.ide.eclipse.model.SourceFolder
@ -29,8 +30,9 @@ subprojects {
description = "Elasticsearch subproject ${project.path}"
}
Path rootPath = rootDir.toPath()
// setup pom license info, but only for artifacts that are part of elasticsearch
configure(subprojects.findAll { it.path.startsWith(':x-plugins') == false }) {
configure(subprojects.findAll { it.projectDir.toPath().startsWith(rootPath) }) {
// we only use maven publish to add tasks for pom generation
plugins.withType(MavenPublishPlugin).whenPluginAdded {