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:
parent
ce811feba7
commit
621643a5c3
|
@ -17,6 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.nio.file.Path
|
||||||
import org.eclipse.jgit.lib.Repository
|
import org.eclipse.jgit.lib.Repository
|
||||||
import org.eclipse.jgit.lib.RepositoryBuilder
|
import org.eclipse.jgit.lib.RepositoryBuilder
|
||||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||||
|
@ -29,8 +30,9 @@ subprojects {
|
||||||
description = "Elasticsearch subproject ${project.path}"
|
description = "Elasticsearch subproject ${project.path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Path rootPath = rootDir.toPath()
|
||||||
// setup pom license info, but only for artifacts that are part of elasticsearch
|
// 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
|
// we only use maven publish to add tasks for pom generation
|
||||||
plugins.withType(MavenPublishPlugin).whenPluginAdded {
|
plugins.withType(MavenPublishPlugin).whenPluginAdded {
|
||||||
|
|
Loading…
Reference in New Issue