blob: c79772dfe5281cf6069dc3f96aac3cb05d46886d [file] [log] [blame]
<!--
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>slider-assembly</artifactId>
<name>Slider Assembly</name>
<packaging>pom</packaging>
<description>Apache Slider is a tool for dynamically deploying distributed applications to an Apache YARN cluster</description>
<parent>
<groupId>org.apache.slider</groupId>
<artifactId>slider</artifactId>
<version>0.52</version>
</parent>
<properties>
<rpm.basedir>/usr/lib/slider</rpm.basedir>
<rpm.confdir>${rpm.basedir}/conf</rpm.confdir>
<rpm.bindir>${rpm.basedir}/bin</rpm.bindir>
<rpm.libdir>${rpm.basedir}/lib</rpm.libdir>
<rpm.agentdir>${rpm.basedir}/agent</rpm.agentdir>
<rpm.username>root</rpm.username>
<rpm.groupname>root</rpm.groupname>
<src.confdir>src/conf-hdp</src.confdir>
<src.libdir>${project.build.directory}/lib</src.libdir>
<src.agent.ini.dir>${project.build.directory}/../../slider-agent/conf</src.agent.ini.dir>
<skipTests>false</skipTests>
</properties>
<build>
<plugins>
<!--read in a build.properties file if defined-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>${maven.properties.version}</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<quiet>true</quiet>
<files>
<file>build.properties</file>
<file>../build.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${maven-exec-plugin.version}</version>
<executions>
<execution>
<configuration>
<executable>python</executable>
<workingDirectory>src/test/python</workingDirectory>
<arguments>
<argument>unitTests.py</argument>
</arguments>
<environmentVariables>
<PYTHONPATH>${project.basedir}/src/main/scripts:${project.basedir}/../slider-agent/src/test/python/mock:${project.basedir}/src/test/python/scripts</PYTHONPATH>
</environmentVariables>
<skip>${skipTests}</skip>
</configuration>
<id>python-test</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- pull in all dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin.version}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<!-- <tarLongFileFormat>gnu</tarLongFileFormat>-->
</configuration>
</execution>
<execution>
<!-- copy in the agent tar file -->
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.slider</groupId>
<artifactId>slider-agent</artifactId>
<type>tar.gz</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/agent</outputDirectory>
<destFileName>slider-agent.tar.gz</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<!-- copy in the agent tar file -->
<id>copy-to-lib</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.slider</groupId>
<artifactId>slider-agent</artifactId>
<type>tar.gz</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>slider-agent.tar.gz</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<inherited>true</inherited>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<inherited>false</inherited>
<configuration>
<rules>
<requireMavenVersion>
<version>${maven.version.range}</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${project.java.src.version}</version>
</requireJavaVersion>
</rules>
</configuration>
<executions>
<execution>
<id>default</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
<!-- assemble the tar file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<configuration>
<tarLongFileMode>gnu</tarLongFileMode>
<descriptors>
<descriptor>src/assembly/slider-bin.xml</descriptor>
</descriptors>
<finalName>slider-${project.version}</finalName>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
</plugins>
</reporting>
<profiles>
<profile>
<id>rpm</id>
<build>
<plugins>
<!-- RPM -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>${maven-rpm-plugin.version}</version>
<executions>
<execution>
<id>generate-rpm</id>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<license>http://www.apache.org/licenses/LICENSE-2.0</license>
<name>slider</name>
<version>${project.version}</version>
<!--
<release>${project.version}</release>
-->
<!---->
<distribution></distribution>
<group>Applications/Engineering</group>
<!--<icon>src/main/resources/icon.gif</icon>-->
<!--<packager>ASF</packager>-->
<prefix>${rpm.basedir}</prefix>
<!--
<changelogFile>src/changelog</changelogFile>
-->
<!-- <defineStatements>
<defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
</defineStatements>-->
<provides>
<provide>apache-slider</provide>
</provides>
<mappings>
<mapping>
<directory>${rpm.basedir}</directory>
<!-- RWXR.XR.X -->
<filemode>755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<sources>
</sources>
</mapping>
<!-- binaries -->
<mapping>
<directory>${rpm.bindir}</directory>
<!-- RWXR.XR.X -->
<filemode>0755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<sources>
<source>
<location>src/main/scripts</location>
</source>
</sources>
</mapping>
<!-- library -->
<mapping>
<directory>${rpm.libdir}</directory>
<!-- RWXR.XR.X -->
<filemode>755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<sources>
<source>
<location>${src.libdir}</location>
</source>
</sources>
</mapping>
<!-- configuration -->
<mapping>
<directory>${rpm.confdir}</directory>
<configuration>true</configuration>
<filemode>0755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<sources>
<source>
<location>${src.confdir}</location>
</source>
</sources>
</mapping>
<!-- agent -->
<mapping>
<directory>${rpm.agentdir}</directory>
<filemode>0755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<directoryIncluded>false</directoryIncluded>
<sources>
<source>
<location>${project.build.directory}/agent</location>
<includes>
<include>slider-agent.tar.gz</include>
</includes>
</source>
</sources>
</mapping>
<!-- agent.ini -->
<mapping>
<directory>${rpm.agentdir}/conf</directory>
<configuration>true</configuration>
<filemode>0755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<directoryIncluded>false</directoryIncluded>
<sources>
<source>
<location>${src.agent.ini.dir}</location>
<includes>
<include>*.ini
</include>
</includes>
</source>
</sources>
</mapping>
<!-- needed to apply attribute to directory -->
<mapping>
<directory>${rpm.agentdir}</directory>
<filemode>0755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<directoryIncluded>true</directoryIncluded>
</mapping>
<mapping>
<directory>${rpm.agentdir}/conf</directory>
<filemode>0755</filemode>
<username>${rpm.username}</username>
<groupname>${rpm.groupname}</groupname>
<directoryIncluded>true</directoryIncluded>
</mapping>
</mappings>
<!--
Scripts. Very dangerous in RPMs unless you know exactly what you are doing.
It's very easy to break the uninstall process, in particular.
-->
<!--
<preinstallScriptlet>
<script>echo "installing slider"</script>
</preinstallScriptlet>
-->
<!--
<postinstallScriptlet>
<scriptFile>src/main/scripts/postinstall</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>
-->
<!--
<preremoveScriptlet>
<scriptFile>src/main/scripts/preremove</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</preremoveScriptlet>
-->
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.apache.slider</groupId>
<artifactId>slider-core</artifactId>
<version>${project.version}</version>
</dependency>
<!--
needed to order the build and ensure the agent tar is found
the test scope ensures that it isn't copied into the lib dir
-->
<dependency>
<groupId>org.apache.slider</groupId>
<artifactId>slider-agent</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>tar.gz</type>
</dependency>
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
</dependency>
</dependencies>
</project>