Skip to content

Instantly share code, notes, and snippets.

@mrbald
Created August 22, 2018 10:57
Show Gist options
  • Save mrbald/71c58feb5032d089f8f9b6cb8ce8a66d to your computer and use it in GitHub Desktop.
Save mrbald/71c58feb5032d089f8f9b6cb8ce8a66d to your computer and use it in GitHub Desktop.
Strict Dependencies Check with Maven
<project ...>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>...</version>
<executions>
<execution>
<id>analyze</id>
<goals>
<goal>analyze-only</goal>
</goals>
<configuration>
<failOnWarning>true</failOnWarning>
<usedDependencies>
<!-- mark dependency as used -->
<dependency>ch.qos.logback:logback-classic</dependency>
</usedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment