Skip to content

Commit e48944c

Browse files
committed
Add enforcer rule for elastic dependencies
1 parent 5899ebb commit e48944c

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

pom.xml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,37 @@ under the License.
378378
</dependencies>
379379
</plugin>
380380

381+
<plugin>
382+
<groupId>org.apache.maven.plugins</groupId>
383+
<artifactId>maven-enforcer-plugin</artifactId>
384+
<executions>
385+
<execution>
386+
<id>ban-elastic-dependencies</id>
387+
<goals>
388+
<goal>enforce</goal>
389+
</goals>
390+
<configuration>
391+
<rules>
392+
<!--
393+
Exclude all Elastic dependencies by default. If there is any Elastic dependency needed,
394+
ensure its usage is compatible with Apache licence and then add it to includes.
395+
-->
396+
<bannedDependencies>
397+
<excludes>
398+
<exclude>org.elasticsearch.*:*</exclude>
399+
</excludes>
400+
<includes>
401+
<include>org.elasticsearch.plugin:x-pack-sql-jdbc:*:*:provided</include>
402+
<include>org.elasticsearch.client:elasticsearch-rest-client:*:*:test</include>
403+
</includes>
404+
<message>Elastic x-pack dependencies are not allowed to be bundled due to licensing issues.</message>
405+
</bannedDependencies>
406+
</rules>
407+
</configuration>
408+
</execution>
409+
</executions>
410+
</plugin>
411+
381412
<plugin>
382413
<groupId>org.apache.maven.plugins</groupId>
383414
<artifactId>maven-jar-plugin</artifactId>
@@ -412,11 +443,6 @@ under the License.
412443
<artifactId>maven-surefire-plugin</artifactId>
413444
</plugin>
414445

415-
<plugin>
416-
<groupId>org.apache.maven.plugins</groupId>
417-
<artifactId>maven-enforcer-plugin</artifactId>
418-
</plugin>
419-
420446
<plugin>
421447
<groupId>org.apache.maven.plugins</groupId>
422448
<artifactId>maven-shade-plugin</artifactId>

0 commit comments

Comments
 (0)