<?xml version="1.0"?>
<!--
 Apache HTTPD logparsing made easy
 Copyright (C) 2013 Niels Basjes

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses />.
-->
<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>httpdlog</artifactId>
    <groupId>nl.basjes.parse.httpdlog</groupId>
    <version>1.4</version>
  </parent>

  <artifactId>httpdlog-pigloader</artifactId>
  <name>Parser - Apache HTTPD - Pig Loader</name>

  <dependencies>
    <dependency>
      <groupId>org.apache.pig</groupId>
      <artifactId>pig</artifactId>
      <version>${pig.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-client</artifactId>
      <version>${hadoop.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>httpdlog-inputformat</artifactId>
      <version>${project.version}</version>
    </dependency>

  </dependencies>

  <profiles>
    <profile>
      <id>rpm</id>
      <activation>
        <property>
          <name>build-rpm</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>rpm-maven-plugin</artifactId>
            <version>2.1-alpha-4</version>
            <configuration>
              <license>GNU General Public License 3.0</license>
              <packager>Niels Basjes</packager>
              <group>Development/Libraries</group>
              <needarch>noarch</needarch>
              <description>
                This is a parser for logfiles generated by the Apache HTTPD.
              </description>
              <!--<release>1</release>-->
              <requires>
                <require>pig &gt; 0.11</require>
              </requires>
              <mappings>
                <mapping>
                  <directory>/usr/lib/hadoop</directory>
                  <username>root</username>
                  <groupname>root</groupname>
                  <sources>
                    <source>
                      <location>target/${project.build.finalName}.jar</location>
                    </source>
                  </sources>
                </mapping>

                <!--<mapping>-->
                <!--<directory>/usr/share/doc/${project.build.finalName}/apidocs</directory>-->
                <!--<username>root</username>-->
                <!--<groupname>root</groupname>-->
                <!--<sources>-->
                <!--<source>-->
                <!--<location>target/apidocs</location>-->
                <!--</source>-->
                <!--</sources>-->
                <!--</mapping>-->

                <!--<mapping>-->
                <!--<directory>/usr/share/doc/${project.build.finalName}/</directory>-->
                <!--<username>root</username>-->
                <!--<groupname>root</groupname>-->
                <!--<sources>-->
                <!--<source>-->
                <!--<location>src/main/resources/mapred-site.xml.example</location>-->
                <!--</source>-->
                <!--</sources>-->
                <!--</mapping>-->

              </mappings>

            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>attached-rpm</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>make-super-jar</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/job.xml</descriptor>
              </descriptors>
              <archive>
                <addMavenDescriptor>true</addMavenDescriptor>
                <manifestEntries>
                  <Class-Path>/</Class-Path>
                </manifestEntries>
              </archive>
              <appendAssemblyId>false</appendAssemblyId>
              <!-- <archive> <addMavenDescriptor>true</addMavenDescriptor> <manifest> <mainClass>${mainClass}</mainClass> </manifest> </archive> -->
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <!-- put the default-jar in the none phase to skip it from being created -->
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
