Skip to content

Instantly share code, notes, and snippets.

@beyondxscratch
Last active August 9, 2020 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beyondxscratch/0b1e0379d7d84f786c51b533ee2ad563 to your computer and use it in GitHub Desktop.
Save beyondxscratch/0b1e0379d7d84f786c51b533ee2ad563 to your computer and use it in GitHub Desktop.
Maven Enforcer Plugin to seal a domain in Hexagonal Architecture
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>*</exclude> <!-- forbids non domain dependencies -->
</excludes>
<includes>
<!-- but allow kotlin dependencies-->
<include>org.jetbrains.kotlin:*</include>
<include>org.jetbrains:annotations</include>
<!-- and test dependencies-->
<include>*:*:*:*:test</include>
</includes>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment