blob: 8ff457eac8d098fd8fbd37408300ba52ca479bcf [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ratis</artifactId>
<groupId>org.apache.ratis</groupId>
<version>0.2.0</version>
</parent>
<artifactId>ratis-hadoop-shaded</artifactId>
<name>Apache Ratis Hadoop Shaded</name>
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
<!--The Default target dir-->
<classes.dir>${project.build.directory}/classes</classes.dir>
<!--The Default location for sources-->
<shaded.sources.dir>src/main/java</shaded.sources.dir>
<!--Version of Hadoop to be shaded -->
<shaded.hadoop.version>${hadoop.version}</shaded.hadoop.version>
</properties>
<build>
<!--I want to override these in profile so define them
with variables up here-->
<sourceDirectory>${shaded.sources.dir}</sourceDirectory>
<outputDirectory>${classes.dir}</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<excludes>org/apache/ratis/shaded/**/*</excludes>
</configuration>
</plugin>
<!-- Make a jar and put the sources in the jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<!--Make it so assembly:single does nothing in here-->
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<exclude>${shaded.sources.dir}/</exclude>
</excludes>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<artifactId>ratis-proto-shaded</artifactId>
<groupId>org.apache.ratis</groupId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${shaded.protobuf.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.protobuf.nano</groupId>
<artifactId>protobuf-javanano</artifactId>
<version>${shaded.protobuf-javanano.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${shaded.hadoop.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
<profiles>
<!-- Skip the tests in this module -->
<profile>
<id>skip-shaded-tests</id>
<activation>
<property>
<name>skip-shaded-tests</name>
</property>
</activation>
<properties>
<surefire.skipFirstPart>true</surefire.skipFirstPart>
</properties>
</profile>
<profile>
<id>clean-shade</id>
<activation>
<property>
<name>!skipCleanShade</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>shaded-clean</id>
<goals>
<goal>clean</goal>
</goals>
<phase>clean</phase>
<configuration>
<filesets>
<fileset>
<directory>${shaded.sources.dir}</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>.</directory>
<includes>
<include>dependency-reduced-pom.xml</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>compile-protobuf</id>
<!--
Shade and drop the generated java files under src/main/java.
-->
<activation>
<property>
<name>!skipShade</name>
</property>
</activation>
<properties>
<profile.id>compile-protobuf</profile.id>
<!--When the compile for this profile runs, make sure it makes jars that
can be related back to this shading profile. Give them a shading prefix.
-->
<jar.finalName>${profile.id}.${project.artifactId}-${project.version}</jar.finalName>
</properties>
<build>
<finalName>${jar.finalName}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadeSourcesContent>true</shadeSourcesContent>
<createSourcesJar>true</createSourcesJar>
<shadedArtifactAttached>true</shadedArtifactAttached>
<relocations>
<relocation>
<pattern>com.google.protobuf</pattern>
<shadedPattern>org.apache.ratis.shaded.com.google.protobuf</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.hadoop.ipc.protobuf</pattern>
<shadedPattern>org.apache.ratis.shaded.org.apache.hadoop.ipc.protobuf</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>org.apache.hadoop:hadoop-common</artifact>
<includes>
<include>org/apache/hadoop/ipc/protobuf/**</include>
</includes>
</filter>
</filters>
<artifactSet>
<excludes>
<exclude>org.apache.ratis:ratis-hadoop-shaded</exclude>
<exclude>com.google.code.findbugs:jsr305</exclude>
<exclude>com.google.code.gson:gson</exclude>
<exclude>com.google.guava:guava</exclude>
<exclude>com.google.protobuf.nano:protobuf-javanano</exclude>
<exclude>com.google.protobuf:protobuf-java</exclude>
<exclude>com.google.re2j:re2j</exclude>
<exclude>com.jamesmurty.utils:java-xmlbuilder</exclude>
<exclude>com.jcraft:jsch</exclude>
<exclude>com.nimbusds:nimbus-jose-jwt</exclude>
<exclude>com.sun.jersey:jersey-core</exclude>
<exclude>com.sun.jersey:jersey-json</exclude>
<exclude>com.sun.jersey:jersey-server</exclude>
<exclude>com.sun.jersey:jersey-servlet</exclude>
<exclude>com.sun.xml.bind:jaxb-impl</exclude>
<exclude>com.thoughtworks.paranamer:paranamer</exclude>
<exclude>commons-beanutils:commons-beanutils-core</exclude>
<exclude>commons-beanutils:commons-beanutils</exclude>
<exclude>commons-cli:commons-cli</exclude>
<exclude>commons-codec:commons-codec</exclude>
<exclude>commons-collections:commons-collections</exclude>
<exclude>commons-configuration:commons-configuration</exclude>
<exclude>commons-digester:commons-digester</exclude>
<exclude>commons-io:commons-io</exclude>
<exclude>commons-lang:commons-lang</exclude>
<exclude>commons-logging:commons-logging</exclude>
<exclude>commons-net:commons-net</exclude>
<exclude>io.netty:netty</exclude>
<exclude>javax.activation:activation</exclude>
<exclude>javax.servlet.jsp:jsp-api</exclude>
<exclude>javax.servlet:servlet-api</exclude>
<exclude>javax.ws.rs:jsr311-api</exclude>
<exclude>javax.xml.bind:jaxb-api</exclude>
<exclude>javax.xml.stream:stax-api</exclude>
<exclude>log4j:log4j</exclude>
<exclude>net.java.dev.jets3t:jets3t</exclude>
<exclude>net.jcip:jcip-annotations</exclude>
<exclude>net.minidev:json-smart</exclude>
<exclude>org.apache.avro:avro</exclude>
<exclude>org.apache.commons:commons-compress</exclude>
<exclude>org.apache.commons:commons-math3</exclude>
<exclude>org.apache.curator:curator-client</exclude>
<exclude>org.apache.curator:curator-framework</exclude>
<exclude>org.apache.curator:curator-recipes</exclude>
<exclude>org.apache.hadoop:hadoop-annotations</exclude>
<exclude>org.apache.hadoop:hadoop-auth</exclude>
<exclude>org.apache.htrace:htrace-core4</exclude>
<exclude>org.apache.httpcomponents:httpclient</exclude>
<exclude>org.apache.httpcomponents:httpcore</exclude>
<exclude>org.apache.kerby:kerb-admin</exclude>
<exclude>org.apache.kerby:kerb-client</exclude>
<exclude>org.apache.kerby:kerb-common</exclude>
<exclude>org.apache.kerby:kerb-core</exclude>
<exclude>org.apache.kerby:kerb-crypto</exclude>
<exclude>org.apache.kerby:kerb-identity</exclude>
<exclude>org.apache.kerby:kerb-server</exclude>
<exclude>org.apache.kerby:kerb-simplekdc</exclude>
<exclude>org.apache.kerby:kerb-util</exclude>
<exclude>org.apache.kerby:kerby-asn1</exclude>
<exclude>org.apache.kerby:kerby-config</exclude>
<exclude>org.apache.kerby:kerby-pkix</exclude>
<exclude>org.apache.kerby:kerby-util</exclude>
<exclude>org.apache.zookeeper:zookeeper</exclude>
<exclude>org.checkerframework:checker-compat-qual</exclude>
<exclude>org.codehaus.jackson:jackson-core-asl</exclude>
<exclude>org.codehaus.jackson:jackson-jaxrs</exclude>
<exclude>org.codehaus.jackson:jackson-mapper-asl</exclude>
<exclude>org.codehaus.jackson:jackson-xc</exclude>
<exclude>org.codehaus.jettison:jettison</exclude>
<exclude>org.mortbay.jetty:jetty-sslengine</exclude>
<exclude>org.mortbay.jetty:jetty-util</exclude>
<exclude>org.mortbay.jetty:jetty</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
<exclude>org.tukaani:xz</exclude>
<exclude>org.xerial.snappy:snappy-java</exclude>
<exclude>xmlenc:xmlenc</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<!--Now unpack the shaded jar made above so the shaded classes
are available to subsequent modules-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<classifier>shaded-sources</classifier>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${basedir}/${shaded.sources.dir}</outputDirectory>
<includes>**/*.java</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>