amahussein commented on a change in pull request #3503:
URL: https://github.com/apache/hadoop/pull/3503#discussion_r722353666
##########
File path: hadoop-common-project/hadoop-auth/pom.xml
##########
@@ -248,6 +248,38 @@
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>de.skuzzle.enforcer</groupId>
+ <artifactId>restrict-imports-enforcer-rule</artifactId>
+ <version>${restrict-imports.enforcer.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>banned-illegal-imports</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <restrictImports
implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
+ <includeTestCode>true</includeTestCode>
+ <reason>Use hadoop-common provided VisibleForTesting rather
than the one provided by Guava</reason>
+ <bannedImports>
+
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
+
<bannedImport>com.google.common.annotations.VisibleForTesting</bannedImport>
+ </bannedImports>
+ </restrictImports>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
Review comment:
Is this new maven dependency necessary?
AFAIK, hadoop repo used CheckStyle to check for packages/classes.
In `hadoop-build-tools/src/main/resources/checkstyle/checkstyle.xml`, there
is a list of `IllegalImport` with packages and classes.
I would prefer having a single interface to define IllegalImports. So
`org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting`
can be added to heckstyle.xml
##########
File path: hadoop-common-project/hadoop-common/pom.xml
##########
@@ -651,6 +651,38 @@
</filesets>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>de.skuzzle.enforcer</groupId>
+ <artifactId>restrict-imports-enforcer-rule</artifactId>
+ <version>${restrict-imports.enforcer.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>banned-illegal-imports</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <restrictImports
implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
+ <includeTestCode>true</includeTestCode>
+ <reason>Use hadoop-common provided VisibleForTesting rather
than the one provided by Guava</reason>
+ <bannedImports>
+
<bannedImport>org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
+
<bannedImport>com.google.common.annotations.VisibleForTesting</bannedImport>
+ </bannedImports>
+ </restrictImports>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
Review comment:
Same as my previous comment. Better to be consistent with other guava
banned imports.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]