pom.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License. See accompanying LICENSE file.
  12. -->
  13. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  14. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  15. <modelVersion>4.0.0</modelVersion>
  16. <parent>
  17. <groupId>org.apache.hadoop</groupId>
  18. <artifactId>hadoop-project</artifactId>
  19. <version>3.0.0-alpha2</version>
  20. <relativePath>../../hadoop-project</relativePath>
  21. </parent>
  22. <artifactId>hadoop-client-check-test-invariants</artifactId>
  23. <version>3.0.0-alpha2</version>
  24. <packaging>pom</packaging>
  25. <description>Enforces our invariants for the testing client modules.</description>
  26. <name>Apache Hadoop Client Packaging Invariants for Test</name>
  27. <properties>
  28. </properties>
  29. <dependencies>
  30. <dependency>
  31. <groupId>org.apache.hadoop</groupId>
  32. <artifactId>hadoop-client-api</artifactId>
  33. </dependency>
  34. <dependency>
  35. <groupId>org.apache.hadoop</groupId>
  36. <artifactId>hadoop-client-runtime</artifactId>
  37. </dependency>
  38. <dependency>
  39. <groupId>org.apache.hadoop</groupId>
  40. <artifactId>hadoop-client-minicluster</artifactId>
  41. </dependency>
  42. </dependencies>
  43. <build>
  44. <plugins>
  45. <plugin>
  46. <groupId>org.apache.maven.plugins</groupId>
  47. <artifactId>maven-enforcer-plugin</artifactId>
  48. <version>1.4</version>
  49. <dependencies>
  50. <dependency>
  51. <groupId>org.codehaus.mojo</groupId>
  52. <artifactId>extra-enforcer-rules</artifactId>
  53. <version>1.0-beta-3</version>
  54. </dependency>
  55. </dependencies>
  56. <executions>
  57. <execution>
  58. <id>enforce-banned-dependencies</id>
  59. <goals>
  60. <goal>enforce</goal>
  61. </goals>
  62. <configuration>
  63. <rules>
  64. <banTransitiveDependencies>
  65. <!--
  66. <message>
  67. Our client-facing artifacts are not supposed to have additional dependencies
  68. and one or more of them do. The output from the enforcer plugin should give
  69. specifics.
  70. </message>
  71. -->
  72. <excludes>
  73. <!-- annotations is provided, and both artifacts exclude the tools transitive,
  74. but enforcer still sees it.
  75. -->
  76. <exclude>org.apache.hadoop:hadoop-annotations</exclude>
  77. <!-- We leave HTrace as an unshaded dependnecy on purpose so that tracing within a JVM will work -->
  78. <exclude>org.apache.htrace:htrace-core4</exclude>
  79. <!-- Leave slf4j unshaded so downstream users can configure logging. -->
  80. <exclude>org.slf4j:slf4j-api</exclude>
  81. <!-- Leave commons-logging unshaded so downstream users can configure logging. -->
  82. <exclude>commons-logging:commons-logging</exclude>
  83. <!-- Leave log4j unshaded so downstream users can configure logging. -->
  84. <exclude>log4j:log4j</exclude>
  85. <!-- Leave JUnit unshaded so downstream can use our test helper classes -->
  86. <exclude>junit:junit</exclude>
  87. <!-- JUnit brings in hamcrest -->
  88. <exclude> org.hamcrest:hamcrest-core</exclude>
  89. </excludes>
  90. </banTransitiveDependencies>
  91. <banDuplicateClasses>
  92. <findAllDuplicates>true</findAllDuplicates>
  93. <dependencies>
  94. <dependency>
  95. <groupId>org.apache.hadoop</groupId>
  96. <artifactId>hadoop-annotations</artifactId>
  97. <ignoreClasses>
  98. <ignoreClass>*</ignoreClass>
  99. </ignoreClasses>
  100. </dependency>
  101. </dependencies>
  102. </banDuplicateClasses>
  103. </rules>
  104. <!-- TODO we need a rule for "we don't have classes that are outside of the org.apache.hadoop package" -->
  105. <!-- TODO we need a rule for "the constants in this set of classes haven't been shaded / don't have this prefix"
  106. Manually checking the set of Keys that look like packages we relocate:
  107. cat `find . \( -name '*Keys.java' -o -name '*KeysPublic.java' \) -a -path '*/src/main/*'` | grep -E "\"(io\.|org\.|com\.|net\.)" | grep -v "^package" | grep -v "^import" | grep -v "\"org.apache.hadoop"
  108. Manually check the set of shaded artifacts to see if the Keys constants have been relocated:
  109. for clazz in `find . \( -name '*Keys.java' -o -name '*KeysPublic.java' \) -a -path '*/src/main/*'`; do
  110. clazz=${clazz#*src/main/java/}
  111. clazz="${clazz%.java}"
  112. javap -cp hadoop-client-modules/hadoop-client-api/target/hadoop-client-api-3.0.0-alpha2-SNAPSHOT.jar:hadoop-client-modules/hadoop-client-runtime/target/hadoop-client-runtime-3.0.0-alpha2-SNAPSHOT.jar:hadoop-client-modules/hadoop-client-minicluster/target/hadoop-client-minicluster-3.0.0-alpha2-SNAPSHOT.jar \
  113. -constants "${clazz//\//.}" | grep "org.apache.hadoop.shaded"
  114. done
  115. -->
  116. </configuration>
  117. </execution>
  118. </executions>
  119. </plugin>
  120. </plugins>
  121. </build>
  122. </project>