HBASE-25333 Add maven enforcer rule to ban VisibleForTesting imports (#2854)

Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
Duo Zhang 2021-01-09 08:50:11 +08:00
parent 09db88d3ba
commit 75f5cb2450
1 changed files with 13 additions and 0 deletions

13
pom.xml
View File

@ -1145,6 +1145,19 @@
<bannedImport>org.glassfish.jersey.**</bannedImport>
</bannedImports>
</restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
<includeTestCode>true</includeTestCode>
<commentLineBufferSize>512</commentLineBufferSize>
<reason>
You should never use this style of annotations(i.e, 'this is for test only')
in IA.Public or IA.LimitedPrivate classes. Use IA.Private to tell users this is
not for public use.
For IA.Private classes, use RestrictedApi annotation in error prone instead.
</reason>
<bannedImports>
<bannedImport>org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
</bannedImports>
</restrictImports>
</rules>
</configuration>
</execution>