Browse Source

Remove dependency license check for all org.elasticsearch (#96355)

The dependency licenses check is meant to ensure we have license
information included for external dependencies. The check currently
looks at all non-project dependencies. This works within the
elasticsearch repo, since internal dependencies are all project
dependencies. However, in serverless the dependencies will be jars from
the upstream project (or rather not project dependencies, since it is a
compound build). This commit loosens the dependency license check filter
to omit any that have an elasticsearch group.
Ryan Ernst 2 years ago
parent
commit
9cee43b24e

+ 4 - 1
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/DependencyLicensesPrecommitPlugin.java

@@ -31,7 +31,10 @@ public class DependencyLicensesPrecommitPlugin extends PrecommitPlugin {
             Configuration compileOnly = project.getConfigurations()
                 .getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME);
             t.setDependencies(
-                runtimeClasspath.fileCollection(dependency -> dependency instanceof ProjectDependency == false).minus(compileOnly)
+                runtimeClasspath.fileCollection(
+                    dependency -> dependency instanceof ProjectDependency == false
+                        && dependency.getGroup().startsWith("org.elasticsearch") == false
+                ).minus(compileOnly)
             );
         });
         return dependencyLicenses;