blob: 04e91c1a9299f2f3705e88a63341a164c8be71d6 [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>
<parent>
<groupId>org.apache</groupId>
<artifactId>sqoop</artifactId>
<version>1.99.6</version>
</parent>
<groupId>org.apache.sqoop</groupId>
<artifactId>sqoop-dist</artifactId>
<name>Sqoop Distribution</name>
<packaging>pom</packaging>
<properties>
<hadoop.version>200</hadoop.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.sqoop</groupId>
<artifactId>sqoop-server</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.apache.sqoop</groupId>
<artifactId>sqoop-shell</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sqoop</groupId>
<artifactId>sqoop-tomcat</artifactId>
</dependency>
</dependencies>
<profiles>
<!-- Build source distribution (activated by -Psource) -->
<profile>
<id>source</id>
<activation>
<activeByDefault>false</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" />
<exclude name="**/.settings/**" />
</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>
<activation>
<activeByDefault>false</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}-bin-hadoop${hadoop.version}"/>
<delete file="target/sqoop-${project.version}-bin-hadoop${hadoop.version}.tar.gz"/>
<!-- Create dist dir -->
<mkdir dir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}"/>
<!-- Copy sources over -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.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" />
<exclude name="**/.settings/**" />
</fileset>
</copy>
<!-- Copy generated documentation -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/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.major.version}/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.version}/server"/>
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/bin">
<fileset dir="src/main/server/bin"/>
</copy>
<chmod dir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/bin" perm="u+x" includes="**/*.sh"/>
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/conf">
<fileset dir="src/main/server/conf"/>
</copy>
<delete dir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/webapps"/>
<mkdir dir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/webapps"/>
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/webapps">
<fileset dir="src/main/server/webapps"/>
</copy>
<copy file="../server/target/sqoop.war"
toDir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/webapps"/>
<copy file="../tomcat/target/sqoop-tomcat-${project.version}.jar"
toDir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/server/lib"/>
<!-- Build shell client directory -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/shell/lib">
<fileset dir="../shell/target/lib">
<include name="*.jar" />
<exclude name="junit-*.jar" />
<exclude name="mockito-*.jar" />
</fileset>
</copy>
<copy file="../shell/target/sqoop-shell-${project.version}.jar"
toDir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/shell/lib"/>
<!-- Build "bin" directory -->
<copy todir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/bin">
<fileset dir="src/main/bin"/>
</copy>
<chmod dir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}/bin" perm="u+x" includes="*"/>
<!-- Finally create distribution tar -->
<tar destfile="target/sqoop-${project.version}-bin-hadoop${hadoop.version}.tar.gz" compression="gzip">
<tarfileset dir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}" prefix="sqoop-${project.version}-bin-hadoop${hadoop.version}" filemode="755">
<include name="**/*.sh" />
<include name="bin/sqoop2-*" />
</tarfileset>
<tarfileset dir="target/sqoop-${project.version}-bin-hadoop${hadoop.version}" prefix="sqoop-${project.version}-bin-hadoop${hadoop.version}">
<include name="**/*" />
<exclude name="bin/sqoop2-*" />
<exclude name="**/*.sh" />
</tarfileset>
</tar>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>