HADOOP-18027. Include static imports in the maven plugin rules (#3733)

Reviewed-by: Steve Loughran <stevel@apache.org>
Signed-off-by: Takanobu Asanuma <tasanuma@apache.org>
This commit is contained in:
Viraj Jasani 2021-12-01 13:18:43 +05:30 committed by GitHub
parent 1ebdac2cd6
commit 4dea4a7b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
pom.xml
View File

@ -182,6 +182,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use hadoop-thirdparty shaded instead of curator shaded</reason> <reason>Use hadoop-thirdparty shaded instead of curator shaded</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.curator.shaded.**</bannedImport> <bannedImport>org.apache.curator.shaded.**</bannedImport>
<bannedImport>static org.apache.curator.shaded.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -189,6 +190,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use hadoop-common provided Sets rather than Guava provided Sets</reason> <reason>Use hadoop-common provided Sets rather than Guava provided Sets</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.collect.Sets</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.collect.Sets</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.collect.Sets.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -196,6 +198,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use hadoop-common provided Lists rather than Guava provided Lists</reason> <reason>Use hadoop-common provided Lists rather than Guava provided Lists</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.collect.Lists</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.collect.Lists</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.collect.Lists.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -210,6 +213,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use alternatives to Guava common classes</reason> <reason>Use alternatives to Guava common classes</reason>
<bannedImports> <bannedImports>
<bannedImport>com.google.common.**</bannedImport> <bannedImport>com.google.common.**</bannedImport>
<bannedImport>static com.google.common.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -217,6 +221,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use alternative to Guava provided BaseEncoding</reason> <reason>Use alternative to Guava provided BaseEncoding</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.io.BaseEncoding</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.io.BaseEncoding</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.io.BaseEncoding.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -224,6 +229,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use alternative to Guava provided Optional</reason> <reason>Use alternative to Guava provided Optional</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Optional</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Optional</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.base.Optional.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -231,6 +237,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use alternative to Guava provided Function</reason> <reason>Use alternative to Guava provided Function</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Function</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Function</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.base.Function.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -238,6 +245,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use alternative to Guava provided Predicate</reason> <reason>Use alternative to Guava provided Predicate</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Predicate</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Predicate</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.base.Predicate.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -245,6 +253,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use alternative to Guava provided Supplier</reason> <reason>Use alternative to Guava provided Supplier</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Supplier</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.base.Supplier</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.base.Supplier.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
@ -252,6 +261,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
<reason>Use alternative to Guava provided ImmutableListMultimap</reason> <reason>Use alternative to Guava provided ImmutableListMultimap</reason>
<bannedImports> <bannedImports>
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableListMultimap</bannedImport> <bannedImport>org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableListMultimap</bannedImport>
<bannedImport>static org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableListMultimap.**</bannedImport>
</bannedImports> </bannedImports>
</restrictImports> </restrictImports>
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">