Вы, возможно, потребуется maven-enforcer-plugin
.
Его набор правил включает правило, запрещающее определенные зависимости от вашего проекта. Это правило «Banned Dependencies».
Вот конфигурации плагина пример из их документации:
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>org.apache.maven</exclude>
<exclude>org.apache.maven:badArtifact</exclude>
<exclude>*:badArtifact</exclude>
</excludes>
<includes>
<!--only 1.0 of badArtifact is allowed-->
<include>org.apache.maven:badArtifact:1.0</include>
</includes>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
Отлично, это именно то, что я искал! Можно включить транзитивную проверку с помощью true searchTransitive> –
Cheers. Обязательно принимайте это как ответ в этом случае! – mystarrocks
Хорошо, как только у меня будет достаточно репутации :) –