Maven Enforcer Plugin to Ban dependency

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<execution>
<id>enforce-ban-deprecated</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>com.group1.domain:artefact1</exclude>
</excludes>
<message>Module artefact1 has been deprecated. Please use the new-artefact1 module instead</message>
</bannedDependencies>
<bannedDependencies>
<excludes>
<exclude>com.group1.domain:artefact2</exclude>
</excludes>
<message>Module artefact2 has been deprecated. Please use the newartefact2 module instead</message>
</bannedDependencies>
</rules>
<fail>false</fail>
</configuration>
</execution>
</plugin>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ayesha M

Ayesha M

I am a software developer, who is easily intrigued by anything tech and is always thriving to make software development more inclusive and empathetic.