HADOOP-13999 Add -DskipShade maven profile to disable jar shading to reduce compile time. Contributed by Arun Suresh

This commit is contained in:
Steve Loughran 2017-01-19 11:49:40 +00:00
parent ed33ce11dd
commit 85e4961f60
4 changed files with 741 additions and 622 deletions

View File

@ -68,149 +68,179 @@
</exclusions> </exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <profiles>
<plugins> <profile>
<!-- We contain no source --> <id>shade</id>
<plugin> <activation>
<groupId>org.apache.maven.plugins</groupId> <property><name>!skipShade</name></property>
<artifactId>maven-source-plugin</artifactId> </activation>
<configuration> <build>
<skipSource>true</skipSource> <plugins>
</configuration> <!-- We contain no source -->
</plugin> <plugin>
<plugin> <groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId>
<artifactId>maven-shade-plugin</artifactId> <configuration>
<dependencies> <skipSource>true</skipSource>
<dependency> </configuration>
<groupId>org.apache.hadoop</groupId> </plugin>
<artifactId>hadoop-maven-plugins</artifactId> <plugin>
<version>${project.version}</version> <groupId>org.apache.maven.plugins</groupId>
</dependency> <artifactId>maven-shade-plugin</artifactId>
</dependencies> <dependencies>
<executions> <dependency>
<execution> <groupId>org.apache.hadoop</groupId>
<phase>package</phase> <artifactId>hadoop-maven-plugins</artifactId>
<goals> <version>${project.version}</version>
<goal>shade</goal> </dependency>
</goals> </dependencies>
<configuration> <executions>
<artifactSet> <execution>
<includes> <phase>package</phase>
<include>org.apache.hadoop:*</include> <goals>
</includes> <goal>shade</goal>
</artifactSet> </goals>
<filters> <configuration>
<!-- We get these package level classes from various yarn api jars --> <artifactSet>
<filter> <includes>
<artifact>org.apache.hadoop:hadoop-yarn-common</artifact> <include>org.apache.hadoop:*</include>
<excludes> </includes>
<exclude>org/apache/hadoop/yarn/factories/package-info.class</exclude> </artifactSet>
<exclude>org/apache/hadoop/yarn/util/package-info.class</exclude> <filters>
<exclude>org/apache/hadoop/yarn/factory/providers/package-info.class</exclude> <!-- We get these package level classes from various yarn api jars -->
<exclude>org/apache/hadoop/yarn/client/api/impl/package-info.class</exclude> <filter>
<exclude>org/apache/hadoop/yarn/client/api/package-info.class</exclude> <artifact>org.apache.hadoop:hadoop-yarn-common</artifact>
</excludes> <excludes>
</filter> <exclude>org/apache/hadoop/yarn/factories/package-info.class</exclude>
</filters> <exclude>org/apache/hadoop/yarn/util/package-info.class</exclude>
<relocations> <exclude>org/apache/hadoop/yarn/factory/providers/package-info.class</exclude>
<relocation> <exclude>org/apache/hadoop/yarn/client/api/impl/package-info.class</exclude>
<pattern>org/</pattern> <exclude>org/apache/hadoop/yarn/client/api/package-info.class</exclude>
<shadedPattern>${shaded.dependency.prefix}.org.</shadedPattern> </excludes>
<excludes> </filter>
<exclude>org/apache/hadoop/*</exclude> </filters>
<exclude>org/apache/hadoop/**/*</exclude> <relocations>
<!-- Our non-shaded htrace and logging libraries --> <relocation>
<exclude>org/apache/htrace/*</exclude> <pattern>org/</pattern>
<exclude>org/apache/htrace/**/*</exclude> <shadedPattern>${shaded.dependency.prefix}.org.</shadedPattern>
<exclude>org/slf4j/*</exclude> <excludes>
<exclude>org/slf4j/**/*</exclude> <exclude>org/apache/hadoop/*</exclude>
<exclude>org/apache/commons/logging/*</exclude> <exclude>org/apache/hadoop/**/*</exclude>
<exclude>org/apache/commons/logging/**/*</exclude> <!-- Our non-shaded htrace and logging libraries -->
<exclude>org/apache/log4j/*</exclude> <exclude>org/apache/htrace/*</exclude>
<exclude>org/apache/log4j/**/*</exclude> <exclude>org/apache/htrace/**/*</exclude>
<exclude>**/pom.xml</exclude> <exclude>org/slf4j/*</exclude>
<!-- Not the org/ packages that are a part of the jdk --> <exclude>org/slf4j/**/*</exclude>
<exclude>org/ietf/jgss/*</exclude> <exclude>org/apache/commons/logging/*</exclude>
<exclude>org/omg/**/*</exclude> <exclude>org/apache/commons/logging/**/*</exclude>
<exclude>org/w3c/dom/*</exclude> <exclude>org/apache/log4j/*</exclude>
<exclude>org/w3c/dom/**/*</exclude> <exclude>org/apache/log4j/**/*</exclude>
<exclude>org/xml/sax/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>org/xml/sax/**/*</exclude> <!-- Not the org/ packages that are a part of the jdk -->
</excludes> <exclude>org/ietf/jgss/*</exclude>
</relocation> <exclude>org/omg/**/*</exclude>
<relocation> <exclude>org/w3c/dom/*</exclude>
<pattern>com/</pattern> <exclude>org/w3c/dom/**/*</exclude>
<shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern> <exclude>org/xml/sax/*</exclude>
<excludes> <exclude>org/xml/sax/**/*</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Not the com/ packages that are a part of particular jdk implementations --> </relocation>
<exclude>com/sun/tools/*</exclude> <relocation>
<exclude>com/sun/javadoc/*</exclude> <pattern>com/</pattern>
<exclude>com/sun/security/*</exclude> <shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern>
<exclude>com/sun/jndi/*</exclude> <excludes>
<exclude>com/sun/management/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>com/sun/tools/**/*</exclude> <!-- Not the com/ packages that are a part of particular jdk implementations -->
<exclude>com/sun/javadoc/**/*</exclude> <exclude>com/sun/tools/*</exclude>
<exclude>com/sun/security/**/*</exclude> <exclude>com/sun/javadoc/*</exclude>
<exclude>com/sun/jndi/**/*</exclude> <exclude>com/sun/security/*</exclude>
<exclude>com/sun/management/**/*</exclude> <exclude>com/sun/jndi/*</exclude>
</excludes> <exclude>com/sun/management/*</exclude>
</relocation> <exclude>com/sun/tools/**/*</exclude>
<relocation> <exclude>com/sun/javadoc/**/*</exclude>
<pattern>io/</pattern> <exclude>com/sun/security/**/*</exclude>
<shadedPattern>${shaded.dependency.prefix}.io.</shadedPattern> <exclude>com/sun/jndi/**/*</exclude>
<excludes> <exclude>com/sun/management/**/*</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Exclude config keys for Hadoop that look like package names --> </relocation>
<exclude>io/compression/*</exclude> <relocation>
<exclude>io/compression/**/*</exclude> <pattern>io/</pattern>
<exclude>io/mapfile/*</exclude> <shadedPattern>${shaded.dependency.prefix}.io.</shadedPattern>
<exclude>io/mapfile/**/*</exclude> <excludes>
<exclude>io/map/index/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>io/seqfile/*</exclude> <!-- Exclude config keys for Hadoop that look like package names -->
<exclude>io/seqfile/**/*</exclude> <exclude>io/compression/*</exclude>
<exclude>io/file/buffer/size</exclude> <exclude>io/compression/**/*</exclude>
<exclude>io/skip/checksum/errors</exclude> <exclude>io/mapfile/*</exclude>
<exclude>io/sort/*</exclude> <exclude>io/mapfile/**/*</exclude>
<exclude>io/serializations</exclude> <exclude>io/map/index/*</exclude>
</excludes> <exclude>io/seqfile/*</exclude>
</relocation> <exclude>io/seqfile/**/*</exclude>
<relocation> <exclude>io/file/buffer/size</exclude>
<pattern>javax/servlet/</pattern> <exclude>io/skip/checksum/errors</exclude>
<shadedPattern>${shaded.dependency.prefix}.javax.servlet.</shadedPattern> <exclude>io/sort/*</exclude>
<excludes> <exclude>io/serializations</exclude>
<exclude>**/pom.xml</exclude> </excludes>
</excludes> </relocation>
</relocation> <relocation>
<relocation> <pattern>javax/servlet/</pattern>
<pattern>net/</pattern> <shadedPattern>${shaded.dependency.prefix}.javax.servlet.</shadedPattern>
<shadedPattern>${shaded.dependency.prefix}.net.</shadedPattern> <excludes>
<excludes> <exclude>**/pom.xml</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Exclude config keys for Hadoop that look like package names --> </relocation>
<exclude>net/topology/*</exclude> <relocation>
<exclude>net/topology/**/*</exclude> <pattern>net/</pattern>
</excludes> <shadedPattern>${shaded.dependency.prefix}.net.</shadedPattern>
</relocation> <excludes>
</relocations> <exclude>**/pom.xml</exclude>
<transformers> <!-- Exclude config keys for Hadoop that look like package names -->
<!-- Needed until MSHADE-182 --> <exclude>net/topology/*</exclude>
<transformer implementation="org.apache.hadoop.maven.plugin.shade.resource.ServicesResourceTransformer"/> <exclude>net/topology/**/*</exclude>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/> </excludes>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"> </relocation>
<addHeader>false</addHeader> </relocations>
</transformer> <transformers>
</transformers> <!-- Needed until MSHADE-182 -->
</configuration> <transformer implementation="org.apache.hadoop.maven.plugin.shade.resource.ServicesResourceTransformer"/>
</execution> <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
</executions> <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
</plugin> <addHeader>false</addHeader>
<plugin> </transformer>
<groupId>org.codehaus.mojo</groupId> </transformers>
<artifactId>license-maven-plugin</artifactId> </configuration>
</plugin> </execution>
</plugins> </executions>
</build> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>noshade</id>
<activation>
<property><name>skipShade</name></property>
</activation>
<build>
<plugins>
<!-- We contain no source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<skipSource>true</skipSource>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>

View File

@ -32,21 +32,6 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-runtime</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-minicluster</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
@ -68,63 +53,107 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <profiles>
<plugins> <profile>
<!-- Because our tests rely on our shaded artifacts, we can't compile <id>shade</id>
them until after the package phase has run. <activation>
--> <property><name>!skipShade</name></property>
<plugin> </activation>
<groupId>org.apache.maven.plugins</groupId> <dependencies>
<artifactId>maven-compiler-plugin</artifactId> <dependency>
<executions> <groupId>org.apache.hadoop</groupId>
<!-- <artifactId>hadoop-client-api</artifactId>
First, let's make sure the normal test-compile doesn't try to <scope>test</scope>
compile our integration tests. </dependency>
--> <dependency>
<execution> <groupId>org.apache.hadoop</groupId>
<id>default-testCompile</id> <artifactId>hadoop-client-runtime</artifactId>
<phase>test-compile</phase> <scope>test</scope>
<configuration> </dependency>
<testExcludes> <dependency>
<testExclude>**/IT*</testExclude> <groupId>org.apache.hadoop</groupId>
<testExclude>**/*IT</testExclude> <artifactId>hadoop-client-minicluster</artifactId>
</testExcludes> <scope>test</scope>
</configuration> </dependency>
</execution> </dependencies>
<!-- <build>
Finally, let's make a 'just for integration tests'-compile that <plugins>
fires off prior to our integration tests but after the package <!-- Because our tests rely on our shaded artifacts, we can't compile
phase has created our shaded artifacts. them until after the package phase has run.
--> -->
<execution> <plugin>
<id>compile-integration-tests</id> <groupId>org.apache.maven.plugins</groupId>
<phase>pre-integration-test</phase> <artifactId>maven-compiler-plugin</artifactId>
<goals> <executions>
<goal>testCompile</goal> <!--
</goals> First, let's make sure the normal test-compile doesn't try to
<configuration> compile our integration tests.
<testIncludes> -->
<testInclude>**/IT*</testInclude> <execution>
<testInclude>**/*IT</testInclude> <id>default-testCompile</id>
</testIncludes> <phase>test-compile</phase>
</configuration> <configuration>
</execution> <testExcludes>
</executions> <testExclude>**/IT*</testExclude>
</plugin> <testExclude>**/*IT</testExclude>
<plugin> </testExcludes>
<groupId>org.apache.maven.plugins</groupId> </configuration>
<artifactId>maven-failsafe-plugin</artifactId> </execution>
<executions> <!--
<execution> Finally, let's make a 'just for integration tests'-compile that
<goals> fires off prior to our integration tests but after the package
<goal>integration-test</goal> phase has created our shaded artifacts.
<goal>verify</goal> -->
</goals> <execution>
</execution> <id>compile-integration-tests</id>
</executions> <phase>pre-integration-test</phase>
</plugin> <goals>
</plugins> <goal>testCompile</goal>
</build> </goals>
<configuration>
<testIncludes>
<testInclude>**/IT*</testInclude>
<testInclude>**/*IT</testInclude>
</testIncludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>noshade</id>
<activation>
<property><name>skipShade</name></property>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>

View File

@ -542,204 +542,234 @@
<!-- skipping guice-servlet because it's above --> <!-- skipping guice-servlet because it's above -->
<!-- skipping io.netty:netty because it's in client --> <!-- skipping io.netty:netty because it's in client -->
</dependencies> </dependencies>
<build> <profiles>
<plugins> <profile>
<!-- We contain no source --> <id>shade</id>
<plugin> <activation>
<groupId>org.apache.maven.plugins</groupId> <property><name>!skipShade</name></property>
<artifactId>maven-source-plugin</artifactId> </activation>
<configuration> <build>
<skipSource>true</skipSource> <plugins>
</configuration> <!-- We contain no source -->
</plugin> <plugin>
<plugin> <groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId>
<artifactId>maven-shade-plugin</artifactId> <configuration>
<dependencies> <skipSource>true</skipSource>
<dependency> </configuration>
<groupId>org.apache.hadoop</groupId> </plugin>
<artifactId>hadoop-maven-plugins</artifactId> <plugin>
<version>${project.version}</version> <groupId>org.apache.maven.plugins</groupId>
</dependency> <artifactId>maven-shade-plugin</artifactId>
</dependencies> <dependencies>
<executions> <dependency>
<execution> <groupId>org.apache.hadoop</groupId>
<phase>package</phase> <artifactId>hadoop-maven-plugins</artifactId>
<goals> <version>${project.version}</version>
<goal>shade</goal> </dependency>
</goals> </dependencies>
<configuration> <executions>
<createSourceJar>true</createSourceJar> <execution>
<artifactSet> <phase>package</phase>
<excludes> <goals>
<!-- Fine to expose our already-shaded deps as dependencies --> <goal>shade</goal>
<exclude>org.apache.hadoop:hadoop-annotations</exclude> </goals>
<exclude>org.apache.hadoop:hadoop-client-api</exclude> <configuration>
<exclude>org.apache.hadoop:hadoop-client-runtime</exclude> <createSourceJar>true</createSourceJar>
<!-- Fine to expose our purposefully not-shaded deps as dependencies --> <artifactSet>
<exclude>org.apache.htrace:htrace-core4</exclude> <excludes>
<exclude>org.slf4j:slf4j-api</exclude> <!-- Fine to expose our already-shaded deps as dependencies -->
<exclude>commons-logging:commons-logging</exclude> <exclude>org.apache.hadoop:hadoop-annotations</exclude>
<exclude>junit:junit</exclude> <exclude>org.apache.hadoop:hadoop-client-api</exclude>
<!-- Keep optional runtime deps out of the shading --> <exclude>org.apache.hadoop:hadoop-client-runtime</exclude>
<exclude>org.apache.hadoop:hadoop-yarn-server-timelineservice</exclude> <!-- Fine to expose our purposefully not-shaded deps as dependencies -->
<exclude>log4j:log4j</exclude> <exclude>org.apache.htrace:htrace-core4</exclude>
<!-- We need a filter that matches just those things that are included in the above artiacts --> <exclude>org.slf4j:slf4j-api</exclude>
</excludes> <exclude>commons-logging:commons-logging</exclude>
</artifactSet> <exclude>junit:junit</exclude>
<filters> <!-- Keep optional runtime deps out of the shading -->
<!-- Some of our dependencies include source, so remove it. --> <exclude>org.apache.hadoop:hadoop-yarn-server-timelineservice</exclude>
<filter> <exclude>log4j:log4j</exclude>
<artifact>*:*</artifact> <!-- We need a filter that matches just those things that are included in the above artiacts -->
<excludes> </excludes>
<exclude>**/*.java</exclude> </artifactSet>
</excludes> <filters>
</filter> <!-- Some of our dependencies include source, so remove it. -->
<!-- We pull in several test jars; keep out the actual test classes --> <filter>
<filter> <artifact>*:*</artifact>
<artifact>*:*</artifact> <excludes>
<excludes> <exclude>**/*.java</exclude>
<exclude>**/Test*.class</exclude> </excludes>
</excludes> </filter>
</filter> <!-- We pull in several test jars; keep out the actual test classes -->
<!-- Since runtime has classes for these jars, we exclude them. <filter>
We still want the java services api files, since those were excluded in runtime <artifact>*:*</artifact>
--> <excludes>
<filter> <exclude>**/Test*.class</exclude>
<artifact>com.sun.jersey:jersey-client</artifact> </excludes>
<excludes> </filter>
<exclude>**/*.class</exclude> <!-- Since runtime has classes for these jars, we exclude them.
</excludes> We still want the java services api files, since those were excluded in runtime
</filter> -->
<filter> <filter>
<artifact>com.sun.jersey:jersey-core</artifact> <artifact>com.sun.jersey:jersey-client</artifact>
<excludes> <excludes>
<exclude>**/*.class</exclude> <exclude>**/*.class</exclude>
</excludes> </excludes>
</filter> </filter>
<filter> <filter>
<artifact>com.sun.jersey:jersey-servlet</artifact> <artifact>com.sun.jersey:jersey-core</artifact>
<excludes> <excludes>
<exclude>**/*.class</exclude> <exclude>**/*.class</exclude>
</excludes> </excludes>
</filter> </filter>
</filters> <filter>
<relocations> <artifact>com.sun.jersey:jersey-servlet</artifact>
<relocation> <excludes>
<pattern>org/</pattern> <exclude>**/*.class</exclude>
<shadedPattern>${shaded.dependency.prefix}.org.</shadedPattern> </excludes>
<excludes> </filter>
<exclude>org/apache/hadoop/*</exclude> </filters>
<exclude>org/apache/hadoop/**/*</exclude> <relocations>
<!-- Our non-shaded htrace and logging libraries --> <relocation>
<exclude>org/apache/htrace/*</exclude> <pattern>org/</pattern>
<exclude>org/apache/htrace/**/*</exclude> <shadedPattern>${shaded.dependency.prefix}.org.</shadedPattern>
<exclude>org/slf4j/*</exclude> <excludes>
<exclude>org/slf4j/**/*</exclude> <exclude>org/apache/hadoop/*</exclude>
<exclude>org/apache/commons/logging/*</exclude> <exclude>org/apache/hadoop/**/*</exclude>
<exclude>org/apache/commons/logging/**/*</exclude> <!-- Our non-shaded htrace and logging libraries -->
<exclude>org/apache/log4j/*</exclude> <exclude>org/apache/htrace/*</exclude>
<exclude>org/apache/log4j/**/*</exclude> <exclude>org/apache/htrace/**/*</exclude>
<exclude>**/pom.xml</exclude> <exclude>org/slf4j/*</exclude>
<!-- Our non-shaded JUnit library --> <exclude>org/slf4j/**/*</exclude>
<exclude>org/junit/*</exclude> <exclude>org/apache/commons/logging/*</exclude>
<exclude>org/junit/**/*</exclude> <exclude>org/apache/commons/logging/**/*</exclude>
<!-- Not the org/ packages that are a part of the jdk --> <exclude>org/apache/log4j/*</exclude>
<exclude>org/ietf/jgss/*</exclude> <exclude>org/apache/log4j/**/*</exclude>
<exclude>org/omg/**/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>org/w3c/dom/*</exclude> <!-- Our non-shaded JUnit library -->
<exclude>org/w3c/dom/**/*</exclude> <exclude>org/junit/*</exclude>
<exclude>org/xml/sax/*</exclude> <exclude>org/junit/**/*</exclude>
<exclude>org/xml/sax/**/*</exclude> <!-- Not the org/ packages that are a part of the jdk -->
</excludes> <exclude>org/ietf/jgss/*</exclude>
</relocation> <exclude>org/omg/**/*</exclude>
<relocation> <exclude>org/w3c/dom/*</exclude>
<pattern>com/</pattern> <exclude>org/w3c/dom/**/*</exclude>
<shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern> <exclude>org/xml/sax/*</exclude>
<excludes> <exclude>org/xml/sax/**/*</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Not the com/ packages that are a part of particular jdk implementations --> </relocation>
<exclude>com/sun/tools/*</exclude> <relocation>
<exclude>com/sun/javadoc/*</exclude> <pattern>com/</pattern>
<exclude>com/sun/security/*</exclude> <shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern>
<exclude>com/sun/jndi/*</exclude> <excludes>
<exclude>com/sun/management/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>com/sun/tools/**/*</exclude> <!-- Not the com/ packages that are a part of particular jdk implementations -->
<exclude>com/sun/javadoc/**/*</exclude> <exclude>com/sun/tools/*</exclude>
<exclude>com/sun/security/**/*</exclude> <exclude>com/sun/javadoc/*</exclude>
<exclude>com/sun/jndi/**/*</exclude> <exclude>com/sun/security/*</exclude>
<exclude>com/sun/management/**/*</exclude> <exclude>com/sun/jndi/*</exclude>
</excludes> <exclude>com/sun/management/*</exclude>
</relocation> <exclude>com/sun/tools/**/*</exclude>
<relocation> <exclude>com/sun/javadoc/**/*</exclude>
<pattern>io/</pattern> <exclude>com/sun/security/**/*</exclude>
<shadedPattern>${shaded.dependency.prefix}.io.</shadedPattern> <exclude>com/sun/jndi/**/*</exclude>
<excludes> <exclude>com/sun/management/**/*</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Exclude config keys for Hadoop that look like package names --> </relocation>
<exclude>io/compression/*</exclude> <relocation>
<exclude>io/compression/**/*</exclude> <pattern>io/</pattern>
<exclude>io/mapfile/*</exclude> <shadedPattern>${shaded.dependency.prefix}.io.</shadedPattern>
<exclude>io/mapfile/**/*</exclude> <excludes>
<exclude>io/map/index/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>io/seqfile/*</exclude> <!-- Exclude config keys for Hadoop that look like package names -->
<exclude>io/seqfile/**/*</exclude> <exclude>io/compression/*</exclude>
<exclude>io/file/buffer/size</exclude> <exclude>io/compression/**/*</exclude>
<exclude>io/skip/checksum/errors</exclude> <exclude>io/mapfile/*</exclude>
<exclude>io/sort/*</exclude> <exclude>io/mapfile/**/*</exclude>
<exclude>io/serializations</exclude> <exclude>io/map/index/*</exclude>
</excludes> <exclude>io/seqfile/*</exclude>
</relocation> <exclude>io/seqfile/**/*</exclude>
<relocation> <exclude>io/file/buffer/size</exclude>
<pattern>javax/el/</pattern> <exclude>io/skip/checksum/errors</exclude>
<shadedPattern>${shaded.dependency.prefix}.javax.el.</shadedPattern> <exclude>io/sort/*</exclude>
<excludes> <exclude>io/serializations</exclude>
<exclude>**/pom.xml</exclude> </excludes>
</excludes> </relocation>
</relocation> <relocation>
<relocation> <pattern>javax/el/</pattern>
<pattern>javax/inject/</pattern> <shadedPattern>${shaded.dependency.prefix}.javax.el.</shadedPattern>
<shadedPattern>${shaded.dependency.prefix}.javax.inject.</shadedPattern> <excludes>
<excludes> <exclude>**/pom.xml</exclude>
<exclude>**/pom.xml</exclude> </excludes>
</excludes> </relocation>
</relocation> <relocation>
<relocation> <pattern>javax/inject/</pattern>
<pattern>javax/servlet/</pattern> <shadedPattern>${shaded.dependency.prefix}.javax.inject.</shadedPattern>
<shadedPattern>${shaded.dependency.prefix}.javax.servlet.</shadedPattern> <excludes>
<excludes> <exclude>**/pom.xml</exclude>
<exclude>**/pom.xml</exclude> </excludes>
</excludes> </relocation>
</relocation> <relocation>
<relocation> <pattern>javax/servlet/</pattern>
<pattern>net/</pattern> <shadedPattern>${shaded.dependency.prefix}.javax.servlet.</shadedPattern>
<shadedPattern>${shaded.dependency.prefix}.net.</shadedPattern> <excludes>
<excludes> <exclude>**/pom.xml</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Exclude config keys for Hadoop that look like package names --> </relocation>
<exclude>net/topology/*</exclude> <relocation>
<exclude>net/topology/**/*</exclude> <pattern>net/</pattern>
</excludes> <shadedPattern>${shaded.dependency.prefix}.net.</shadedPattern>
</relocation> <excludes>
</relocations> <exclude>**/pom.xml</exclude>
<transformers> <!-- Exclude config keys for Hadoop that look like package names -->
<!-- Needed until MSHADE-182 --> <exclude>net/topology/*</exclude>
<transformer implementation="org.apache.hadoop.maven.plugin.shade.resource.ServicesResourceTransformer"/> <exclude>net/topology/**/*</exclude>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/> </excludes>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"> </relocation>
<addHeader>false</addHeader> </relocations>
</transformer> <transformers>
</transformers> <!-- Needed until MSHADE-182 -->
</configuration> <transformer implementation="org.apache.hadoop.maven.plugin.shade.resource.ServicesResourceTransformer"/>
</execution> <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
</executions> <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
</plugin> <addHeader>false</addHeader>
<plugin> </transformer>
<groupId>org.codehaus.mojo</groupId> </transformers>
<artifactId>license-maven-plugin</artifactId> </configuration>
</plugin> </execution>
</plugins> </executions>
</build> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>noshade</id>
<activation>
<property><name>skipShade</name></property>
</activation>
<build>
<plugins>
<!-- We contain no source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<skipSource>true</skipSource>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>

View File

@ -105,214 +105,244 @@
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <profiles>
<plugins> <profile>
<!-- We contain no source --> <id>shade</id>
<plugin> <activation>
<groupId>org.apache.maven.plugins</groupId> <property><name>!skipShade</name></property>
<artifactId>maven-source-plugin</artifactId> </activation>
<configuration> <build>
<skipSource>true</skipSource> <plugins>
</configuration> <!-- We contain no source -->
</plugin> <plugin>
<plugin> <groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId>
<artifactId>maven-shade-plugin</artifactId> <configuration>
<dependencies> <skipSource>true</skipSource>
<dependency> </configuration>
<groupId>org.apache.hadoop</groupId> </plugin>
<artifactId>hadoop-maven-plugins</artifactId> <plugin>
<version>${project.version}</version> <groupId>org.apache.maven.plugins</groupId>
</dependency> <artifactId>maven-shade-plugin</artifactId>
</dependencies> <dependencies>
<executions> <dependency>
<execution> <groupId>org.apache.hadoop</groupId>
<phase>package</phase> <artifactId>hadoop-maven-plugins</artifactId>
<goals> <version>${project.version}</version>
<goal>shade</goal> </dependency>
</goals> </dependencies>
<configuration> <executions>
<createSourceJar>true</createSourceJar> <execution>
<artifactSet> <phase>package</phase>
<excludes> <goals>
<!-- We need a filter that matches just those things that aer included in the api jar --> <goal>shade</goal>
<exclude>org.apache.hadoop:hadoop-client-api</exclude> </goals>
<!-- Leave HTrace as an unshaded dependency on purpose, since a static class member is used to trace within a given JVM instance --> <configuration>
<exclude>org.apache.htrace:htrace-core4</exclude> <createSourceJar>true</createSourceJar>
<!-- Leave slf4j unshaded so downstream users can configure logging. --> <artifactSet>
<exclude>org.slf4j:slf4j-api</exclude> <excludes>
<!-- Leave commons-logging unshaded so downstream users can configure logging. --> <!-- We need a filter that matches just those things that aer included in the api jar -->
<exclude>commons-logging:commons-logging</exclude> <exclude>org.apache.hadoop:hadoop-client-api</exclude>
<!-- Leave log4j unshaded so downstream users can configure logging. --> <!-- Leave HTrace as an unshaded dependency on purpose, since a static class member is used to trace within a given JVM instance -->
<exclude>log4j:log4j</exclude> <exclude>org.apache.htrace:htrace-core4</exclude>
</excludes> <!-- Leave slf4j unshaded so downstream users can configure logging. -->
</artifactSet> <exclude>org.slf4j:slf4j-api</exclude>
<filters> <!-- Leave commons-logging unshaded so downstream users can configure logging. -->
<!-- We need a filter that matches just those things that are included in the api jar --> <exclude>commons-logging:commons-logging</exclude>
<filter> <!-- Leave log4j unshaded so downstream users can configure logging. -->
<artifact>org.apache.hadoop:*</artifact> <exclude>log4j:log4j</exclude>
<excludes> </excludes>
<exclude>**/*</exclude> </artifactSet>
<exclude>*</exclude> <filters>
</excludes> <!-- We need a filter that matches just those things that are included in the api jar -->
</filter> <filter>
<!-- Some of our dependencies include source, so remove it. --> <artifact>org.apache.hadoop:*</artifact>
<filter> <excludes>
<artifact>*:*</artifact> <exclude>**/*</exclude>
<excludes> <exclude>*</exclude>
<exclude>**/*.java</exclude> </excludes>
</excludes> </filter>
</filter> <!-- Some of our dependencies include source, so remove it. -->
<!-- We only want one copy of the Localizer class. So long as we keep jasper compiler and runtime on the same version, which one doesn't matter --> <filter>
<filter> <artifact>*:*</artifact>
<artifact>tomcat:jasper-compiler</artifact> <excludes>
<excludes> <exclude>**/*.java</exclude>
<exclude>org/apache/jasper/compiler/Localizer.class</exclude> </excludes>
</excludes> </filter>
</filter> <!-- We only want one copy of the Localizer class. So long as we keep jasper compiler and runtime on the same version, which one doesn't matter -->
<!-- We only have xerces as a dependency for XML output for the fsimage edits, we don't need anything specific to it for javax xml support --> <filter>
<filter> <artifact>tomcat:jasper-compiler</artifact>
<artifact>xerces:xercesImpl</artifact> <excludes>
<excludes> <exclude>org/apache/jasper/compiler/Localizer.class</exclude>
<exclude>META-INF/services/*</exclude> </excludes>
</excludes> </filter>
</filter> <!-- We only have xerces as a dependency for XML output for the fsimage edits, we don't need anything specific to it for javax xml support -->
<!-- We rely on jersey for our web interfaces. We want to use its java services stuff only internal to jersey --> <filter>
<filter> <artifact>xerces:xercesImpl</artifact>
<artifact>com.sun.jersey:*</artifact> <excludes>
<excludes> <exclude>META-INF/services/*</exclude>
<exclude>META-INF/services/javax.*</exclude> </excludes>
</excludes> </filter>
</filter> <!-- We rely on jersey for our web interfaces. We want to use its java services stuff only internal to jersey -->
</filters> <filter>
<relocations> <artifact>com.sun.jersey:*</artifact>
<relocation> <excludes>
<pattern>org/</pattern> <exclude>META-INF/services/javax.*</exclude>
<shadedPattern>${shaded.dependency.prefix}.org.</shadedPattern> </excludes>
<excludes> </filter>
<exclude>org/apache/hadoop/*</exclude> </filters>
<exclude>org/apache/hadoop/**/*</exclude> <relocations>
<!-- Our non-shaded htrace and logging libraries --> <relocation>
<exclude>org/apache/htrace/*</exclude> <pattern>org/</pattern>
<exclude>org/apache/htrace/**/*</exclude> <shadedPattern>${shaded.dependency.prefix}.org.</shadedPattern>
<exclude>org/slf4j/*</exclude> <excludes>
<exclude>org/slf4j/**/*</exclude> <exclude>org/apache/hadoop/*</exclude>
<exclude>org/apache/commons/logging/*</exclude> <exclude>org/apache/hadoop/**/*</exclude>
<exclude>org/apache/commons/logging/**/*</exclude> <!-- Our non-shaded htrace and logging libraries -->
<exclude>org/apache/log4j/*</exclude> <exclude>org/apache/htrace/*</exclude>
<exclude>org/apache/log4j/**/*</exclude> <exclude>org/apache/htrace/**/*</exclude>
<exclude>**/pom.xml</exclude> <exclude>org/slf4j/*</exclude>
<!-- Not the org/ packages that are a part of the jdk --> <exclude>org/slf4j/**/*</exclude>
<exclude>org/ietf/jgss/*</exclude> <exclude>org/apache/commons/logging/*</exclude>
<exclude>org/omg/**/*</exclude> <exclude>org/apache/commons/logging/**/*</exclude>
<exclude>org/w3c/dom/*</exclude> <exclude>org/apache/log4j/*</exclude>
<exclude>org/w3c/dom/**/*</exclude> <exclude>org/apache/log4j/**/*</exclude>
<exclude>org/xml/sax/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>org/xml/sax/**/*</exclude> <!-- Not the org/ packages that are a part of the jdk -->
</excludes> <exclude>org/ietf/jgss/*</exclude>
</relocation> <exclude>org/omg/**/*</exclude>
<relocation> <exclude>org/w3c/dom/*</exclude>
<pattern>com/</pattern> <exclude>org/w3c/dom/**/*</exclude>
<shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern> <exclude>org/xml/sax/*</exclude>
<excludes> <exclude>org/xml/sax/**/*</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Not the com/ packages that are a part of particular jdk implementations --> </relocation>
<exclude>com/sun/tools/*</exclude> <relocation>
<exclude>com/sun/javadoc/*</exclude> <pattern>com/</pattern>
<exclude>com/sun/security/*</exclude> <shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern>
<exclude>com/sun/jndi/*</exclude> <excludes>
<exclude>com/sun/management/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>com/sun/tools/**/*</exclude> <!-- Not the com/ packages that are a part of particular jdk implementations -->
<exclude>com/sun/javadoc/**/*</exclude> <exclude>com/sun/tools/*</exclude>
<exclude>com/sun/security/**/*</exclude> <exclude>com/sun/javadoc/*</exclude>
<exclude>com/sun/jndi/**/*</exclude> <exclude>com/sun/security/*</exclude>
<exclude>com/sun/management/**/*</exclude> <exclude>com/sun/jndi/*</exclude>
</excludes> <exclude>com/sun/management/*</exclude>
</relocation> <exclude>com/sun/tools/**/*</exclude>
<relocation> <exclude>com/sun/javadoc/**/*</exclude>
<pattern>io/</pattern> <exclude>com/sun/security/**/*</exclude>
<shadedPattern>${shaded.dependency.prefix}.io.</shadedPattern> <exclude>com/sun/jndi/**/*</exclude>
<excludes> <exclude>com/sun/management/**/*</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Exclude config keys for Hadoop that look like package names --> </relocation>
<exclude>io/compression/*</exclude> <relocation>
<exclude>io/compression/**/*</exclude> <pattern>io/</pattern>
<exclude>io/mapfile/*</exclude> <shadedPattern>${shaded.dependency.prefix}.io.</shadedPattern>
<exclude>io/mapfile/**/*</exclude> <excludes>
<exclude>io/map/index/*</exclude> <exclude>**/pom.xml</exclude>
<exclude>io/seqfile/*</exclude> <!-- Exclude config keys for Hadoop that look like package names -->
<exclude>io/seqfile/**/*</exclude> <exclude>io/compression/*</exclude>
<exclude>io/file/buffer/size</exclude> <exclude>io/compression/**/*</exclude>
<exclude>io/skip/checksum/errors</exclude> <exclude>io/mapfile/*</exclude>
<exclude>io/sort/*</exclude> <exclude>io/mapfile/**/*</exclude>
<exclude>io/serializations</exclude> <exclude>io/map/index/*</exclude>
</excludes> <exclude>io/seqfile/*</exclude>
</relocation> <exclude>io/seqfile/**/*</exclude>
<relocation> <exclude>io/file/buffer/size</exclude>
<pattern>javax/el/</pattern> <exclude>io/skip/checksum/errors</exclude>
<shadedPattern>${shaded.dependency.prefix}.javax.el.</shadedPattern> <exclude>io/sort/*</exclude>
<excludes> <exclude>io/serializations</exclude>
<exclude>**/pom.xml</exclude> </excludes>
</excludes> </relocation>
</relocation> <relocation>
<relocation> <pattern>javax/el/</pattern>
<pattern>javax/servlet/</pattern> <shadedPattern>${shaded.dependency.prefix}.javax.el.</shadedPattern>
<shadedPattern>${shaded.dependency.prefix}.javax.servlet.</shadedPattern> <excludes>
<excludes> <exclude>**/pom.xml</exclude>
<exclude>**/pom.xml</exclude> </excludes>
</excludes> </relocation>
</relocation> <relocation>
<relocation> <pattern>javax/servlet/</pattern>
<pattern>net/</pattern> <shadedPattern>${shaded.dependency.prefix}.javax.servlet.</shadedPattern>
<shadedPattern>${shaded.dependency.prefix}.net.</shadedPattern> <excludes>
<excludes> <exclude>**/pom.xml</exclude>
<exclude>**/pom.xml</exclude> </excludes>
<!-- Exclude config keys for Hadoop that look like package names --> </relocation>
<exclude>net/topology/*</exclude> <relocation>
<exclude>net/topology/**/*</exclude> <pattern>net/</pattern>
</excludes> <shadedPattern>${shaded.dependency.prefix}.net.</shadedPattern>
</relocation> <excludes>
<!-- probably not. --> <exclude>**/pom.xml</exclude>
<!-- <!-- Exclude config keys for Hadoop that look like package names -->
<relocation> <exclude>net/topology/*</exclude>
<pattern>javax/</pattern> <exclude>net/topology/**/*</exclude>
<shadedPattern>${shaded.dependency.prefix}.javax.</shadedPattern> </excludes>
<excludes> </relocation>
<exclude>**/pom.xml</exclude> <!-- probably not. -->
</excludes> <!--
</relocation> <relocation>
--> <pattern>javax/</pattern>
</relocations> <shadedPattern>${shaded.dependency.prefix}.javax.</shadedPattern>
<transformers> <excludes>
<!-- Needed until MSHADE-182 --> <exclude>**/pom.xml</exclude>
<transformer implementation="org.apache.hadoop.maven.plugin.shade.resource.ServicesResourceTransformer"/> </excludes>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/> </relocation>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"> -->
<addHeader>false</addHeader> </relocations>
</transformer> <transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"> <!-- Needed until MSHADE-182 -->
<resource>META-INF/jboss-beans.xml</resource> <transformer implementation="org.apache.hadoop.maven.plugin.shade.resource.ServicesResourceTransformer"/>
<!-- Add this to enable loading of DTDs <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
<ignoreDtd>false</ignoreDtd> <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
--> <addHeader>false</addHeader>
</transformer> </transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>META-INF/mailcap.default</resource> <resource>META-INF/jboss-beans.xml</resource>
</transformer> <!-- Add this to enable loading of DTDs
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <ignoreDtd>false</ignoreDtd>
<resource>META-INF/mimetypes.default</resource> -->
</transformer> </transformer>
</transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
</configuration> <resource>META-INF/mailcap.default</resource>
</execution> </transformer>
</executions> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
</plugin> <resource>META-INF/mimetypes.default</resource>
<plugin> </transformer>
<groupId>org.codehaus.mojo</groupId> </transformers>
<artifactId>license-maven-plugin</artifactId> </configuration>
</plugin> </execution>
</plugins> </executions>
</build> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>noshade</id>
<activation>
<property><name>skipShade</name></property>
</activation>
<build>
<plugins>
<!-- We contain no source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<skipSource>true</skipSource>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>