hbase/hbase-assembly/pom.xml

338 lines
12 KiB
XML

<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">
<!--
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
-->
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hbase</artifactId>
<groupId>org.apache.hbase</groupId>
<version>0.95-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hbase-assembly</artifactId>
<name>HBase - Assembly</name>
<description>Assembly all HBase modules into deployable packages</description>
<properties>
<!-- Have to hardcode the final here because the submodule can't seem to resolve parent in ant tasks -->
<final.dir.name>hbase-${project.version}</final.dir.name>
</properties>
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself.
Ensures that we don't error on the plugins as unrecognized-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<versionRange>[1.6,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- Run the ant packaging to build the directory to tar -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<skipAssembly>false</skipAssembly>
<attach>false</attach>
<tarLongFileMode>gnu</tarLongFileMode>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/all.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>prepare-package</id>
<phase>prepare-package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Include the arc integration in an early phase -->
<execution>
<id>arc-setup</id>
<phase>initialize</phase>
<configuration>
<tasks if="arc">
<get dest="${project.build.directory}/arc-jira.tar.gz"
src="https://github.com/facebook/arc-jira/tarball/master" />
<untar src="${project.build.directory}/arc-jira.tar.gz"
compression="gzip" dest="${project.build.directory}">
<patternset>
<include name="facebook-arc-jira-*/arc_jira_lib/**" />
</patternset>
</untar>
<move todir="${basedir}">
<fileset dir="${project.build.directory}">
<include name="facebook-arc-jira-*/arc_jira_lib/**" />
</fileset>
<mapper type="regexp" from="^facebook-arc-jira-([^/])*/(.*)"
to="\.\2" />
</move>
<delete includeemptydirs="true">
<fileset dir="${project.build.directory}">
<include name="facebook-arc-jira-*" />
<include name="arc-jira.tar.gz" />
</fileset>
</delete>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!-- Do the final packaging steps -->
<execution>
<id>package</id>
<phase>package</phase>
<configuration>
<target>
<!-- Complements the assembly -->
<mkdir
dir="${project.build.directory}/${project.build.finalName}/lib/native/${build.platform}" />
<!-- Using Unix cp to preserve symlinks, using script to handle wildcards
to manage movement of the nativelibs -->
<echo file="${project.build.directory}/copynativelibs.sh">
if [ `ls ${project.build.directory}/nativelib |
wc -l` -ne 0 ]; then
cp -PR
${project.build.directory}/nativelib/lib*
${project.build.directory}/${project.build.finalName}/${project.build.finalName}/lib/native/${build.platform}
fi
</echo>
<!-- Do the native lib copying -->
<exec executable="sh" dir="${project.build.directory}"
failonerror="true">
<arg line="./copynativelibs.sh" />
</exec>
<!-- move the output directory to the 'final' one -->
<move todir="${project.build.directory}/${final.dir.name}">
<fileset dir="${project.build.directory}/${project.build.finalName}" />
</move>
<!-- Using Unix tar to preserve symlinks when building final tarball -->
<!-- This puts the tarball in the parent directory, so we don't need to move it later -->
<exec executable="tar" failonerror="yes"
dir="${project.build.directory}">
<arg value="czf" />
<arg value="${basedir}/../target/${final.dir.name}.tar.gz" />
<arg value="${final.dir.name}" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<artifactId>hbase-server</artifactId>
<groupId>org.apache.hbase</groupId>
<scope>compile</scope>
</dependency>
<!-- This should be added back in when maven fixes intra-project dependencies -->
<!-- See http://jira.codehaus.org/browse/MNG-2045 and http://jira.codehaus.org/browse/MNG-3559 -->
<!-- <dependency>
<artifactId>hbase-core</artifactId>
<groupId>org.apache.hbase</groupId>
<type>test-jar</type>
<scope>runtime</scope>
</dependency> -->
</dependencies>
<profiles>
<!-- Building packages -->
<profile>
<id>rpm</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>build-rpm</id>
<phase>package</phase>
<configuration>
<target>
<ant antfile="${basedir}/src/packages/build.xml">
<target name="package-rpm" />
<target name="package-conf-pseudo-rpm" />
</ant>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>deb</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>build-deb</id>
<phase>package</phase>
<configuration>
<target>
<property name="artifactId" value="${project.artifactId}" />
<ant antfile="${basedir}/src/packages/build.xml">
<target name="package-deb"/>
<target name="package-conf-pseudo-deb"/>
</ant>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.vafer</groupId>
<artifactId>jdeb</artifactId>
<version>0.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
<!-- Special builds -->
<!-- Including the snappy library -->
<profile>
<id>hadoop-snappy</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>snappy</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-snappy</artifactId>
<version>${hadoop-snappy.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Add the snappy resources if the snappy goal is enabled -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<target description="Include the snappy libs as a tarball">
<exec executable="tar" dir="${project.build.directory}/nativelib"
failonerror="false">
<arg value="xf" />
<arg value="hadoop-snappy-nativelibs.tar" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-hadoop-snappy-native</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-snappy</artifactId>
<version>${hadoop-snappy.version}</version>
<classifier>${build.platform}</classifier>
<type>tar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/nativelib</outputDirectory>
<destFileName>hadoop-snappy-nativelibs.tar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>