Skip to content

Commit c742808

Browse files
committed
Add enforcer rule for elastic dependencies
1 parent 1fb8a25 commit c742808

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
@@ -366,6 +366,37 @@ under the License.
366366
</dependencies>
367367
</plugin>
368368

369+
<plugin>
370+
<groupId>org.apache.maven.plugins</groupId>
371+
<artifactId>maven-enforcer-plugin</artifactId>
372+
<executions>
373+
<execution>
374+
<id>ban-elastic-dependencies</id>
375+
<goals>
376+
<goal>enforce</goal>
377+
</goals>
378+
<configuration>
379+
<rules>
380+
<!--
381+
Exclude all Elastic dependencies by default. If there is any Elastic dependency needed,
382+
ensure its usage is compatible with Apache licence and then add it to includes.
383+
-->
384+
<bannedDependencies>
385+
<excludes>
386+
<exclude>org.elasticsearch.*:*</exclude>
387+
</excludes>
388+
<includes>
389+
<include>org.elasticsearch.plugin:x-pack-sql-jdbc:*:*:provided</include>
390+
<include>org.elasticsearch.client:elasticsearch-rest-client:*:*:test</include>
391+
</includes>
392+
<message>Elastic x-pack dependencies are not allowed to be bundled due to licensing issues.</message>
393+
</bannedDependencies>
394+
</rules>
395+
</configuration>
396+
</execution>
397+
</executions>
398+
</plugin>
399+
369400
<plugin>
370401
<groupId>org.apache.maven.plugins</groupId>
371402
<artifactId>maven-jar-plugin</artifactId>
@@ -400,11 +431,6 @@ under the License.
400431
<artifactId>maven-surefire-plugin</artifactId>
401432
</plugin>
402433

403-
<plugin>
404-
<groupId>org.apache.maven.plugins</groupId>
405-
<artifactId>maven-enforcer-plugin</artifactId>
406-
</plugin>
407-
408434
<plugin>
409435
<groupId>org.apache.maven.plugins</groupId>
410436
<artifactId>maven-shade-plugin</artifactId>

0 commit comments

Comments
 (0)