blob: e94d3d9e15143221b23ce7a9b3a027a404475ad9 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<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>
<properties>
<tomcat.majorVersion>6</tomcat.majorVersion>
<tomcat.minorVersion>0.36</tomcat.minorVersion>
<tomcat.version>${tomcat.majorVersion}.${tomcat.minorVersion}</tomcat.version>
</properties>
<parent>
<groupId>org.apache</groupId>
<artifactId>sqoop</artifactId>
<version>1.99.1</version>
</parent>
<groupId>org.apache.sqoop</groupId>
<artifactId>sqoop-dist</artifactId>
<name>Sqoop Distribution</name>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.apache.sqoop</groupId>
<artifactId>sqoop-server</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.apache.sqoop</groupId>
<artifactId>sqoop-client</artifactId>
</dependency>
</dependencies>
<!--
TODO(jarcec): Binary tarball should publish build documentation
-->
<profiles>
<!-- Build source distribution (activated by default) -->
<profile>
<id>source</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Clean up -->
<delete dir="target/sqoop-${project.version}"/>
<delete file="target/sqoop-${project.version}.tar.gz"/>
<!-- Copy sources over -->
<copy todir="target/sqoop-${project.version}" includeEmptyDirs="false" flatten="false">
<fileset dir="../">
<include name="**/*" />
<exclude name="build/**" />
<exclude name="**/target/**" />
<exclude name=".git/**" />
<exclude name="tags" />
<exclude name=".project" />
<exclude name=".classpath" />
</fileset>
</copy>
<!-- Create dist dir -->
<mkdir dir="target/sqoop-${project.version}"/>
<!-- Create final distribution tar -->
<tar destfile="target/sqoop-${project.version}.tar.gz" compression="gzip">
<tarfileset dir="target/sqoop-${project.version}" prefix="sqoop-${project.version}" filemode="755">
<include name="**/*.sh" />
</tarfileset>
<tarfileset dir="target/sqoop-${project.version}" prefix="sqoop-${project.version}">
<include name="**/*" />
<exclude name="**/bin/*" />
</tarfileset>
</tar>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Build binary distribution (activated by -Pbinary) -->
<profile>
<id>binary</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Clean up -->
<delete dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}"/>
<delete file="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}.tar.gz"/>
<!-- Create dist dir -->
<mkdir dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}"/>
<!-- Copy sources over -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}" includeEmptyDirs="false" flatten="false">
<fileset dir="../">
<include name="**/*" />
<exclude name="build/**" />
<exclude name="**/target/**" />
<exclude name=".git/**" />
<exclude name="tags" />
<exclude name=".project" />
<exclude name=".classpath" />
</fileset>
</copy>
<!-- Copy generated documentation (must be generated prior packing by calling mvn site!) -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/docs" includeEmptyDirs="false" flatten="false">
<fileset dir="../docs/target/site">
<include name="**/*" />
</fileset>
</copy>
<!-- Build server directory -->
<get src="http://archive.apache.org/dist/tomcat/tomcat-${tomcat.majorVersion}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.tar.gz"
dest="target/apache-tomcat.tar.gz" verbose="true" skipexisting="true"/>
<untar src="target/apache-tomcat.tar.gz" dest="target" compression="gzip"/>
<move file="target/apache-tomcat-${tomcat.version}" tofile="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server"/>
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server/bin">
<fileset dir="src/main/server/bin"/>
</copy>
<chmod dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server/bin" perm="u+x" includes="**/*.sh"/>
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server/conf">
<fileset dir="src/main/server/conf"/>
</copy>
<delete dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server/webapps"/>
<mkdir dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server/webapps"/>
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server/webapps">
<fileset dir="src/main/server/webapps"/>
</copy>
<copy file="../server/target/sqoop.war"
toDir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/server/webapps"/>
<!-- Build client directory -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/client/lib">
<fileset dir="../client/target/lib">
<include name="*.jar" />
<exclude name="junit-*.jar" />
</fileset>
</copy>
<copy file="../client/target/sqoop-client-${project.version}.jar"
toDir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/client/lib"/>
<!-- Build "bin" directory -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/bin">
<fileset dir="src/main/bin"/>
</copy>
<chmod dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}/bin" perm="u+x" includes="**/*.sh"/>
<!-- Finally create distribution tar -->
<tar destfile="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}.tar.gz" compression="gzip">
<tarfileset dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}" prefix="sqoop-${project.version}-bin-hadoop${hadoop.profile}" filemode="755">
<include name="**/*.sh" />
</tarfileset>
<tarfileset dir="target/sqoop-${project.version}-bin-hadoop${hadoop.profile}" prefix="sqoop-${project.version}-bin-hadoop${hadoop.profile}">
<include name="**/*" />
<exclude name="**/*.sh" />
</tarfileset>
</tar>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Hadoop 1.x -->
<profile>
<id>hadoop100</id>
<activation>
<property>
<name>hadoop.profile</name>
<value>100</value>
</property>
</activation>
</profile>
<!-- Hadoop 2.x (active by default) -->
<profile>
<id>hadoop200</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>hadoop.profile</name>
<value>200</value>
</property>
</activation>
<properties>
<hadoop.profile>200</hadoop.profile>
</properties>
</profile>
</profiles>
</project>