Skip to content

Instantly share code, notes, and snippets.

@yamanyar
Last active December 11, 2015 22:39
Show Gist options
  • Save yamanyar/4671474 to your computer and use it in GitHub Desktop.
Save yamanyar/4671474 to your computer and use it in GitHub Desktop.
<build>
<plugins>
<plugin>
<groupId>com.yamanyar</groupId>
<artifactId>restrict-maven-plugin</artifactId>
<version>0.6</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>restrict</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- If you set continueOnError to true; build will be not broken; only log will be printed-->
<continueOnError>false</continueOnError>
<restrictions>
<!-- Restrict all access from com.ya* (except from com.yamanyar.test.MyTestDef) to java.util.regex.* and to java.io.PrintStre*.pri*ln() -->
<restriction>com.ya*,!com.yamanyar.test.MyTestDef to java.util.regex.*,java.io.PrintStre*.pri*ln()</restriction>
<!-- Restrict all access from * (except from *MyTestDef and com.yamanyar.none.*) to sun.net.www.http.HttpClient -->
<restriction>*,!*MyTestDef,!com.yamanyar.none.* to sun.net.www.http.HttpClient</restriction>
<!-- Restrict all access from org.apache.commons.io.* to java.nio.* (except to java.nio.Buffer) -->
<restriction>org.apache.commons.io.* to java.nio.*,!java.nio.Buffer</restriction>
<!-- This is not tested in integration test; just for sample usage
Restrict all access from org.*,com.* (except from net.*,gov.*)
to co.uk.*,com.tr.* (except to eu.*,li.*)-->
<restriction>org.*,com.*,!net.*,!gov.* to co.uk.*,com.tr.*,!eu.*,!li.*</restriction>
</restrictions>
</configuration>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment