<?xml version="1.0"?>
<!--
  ~ Yet Another UserAgent Analyzer
  ~ Copyright (C) 2013-2017 Niels Basjes
  ~
  ~ Licensed 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
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>yauaa-parent</artifactId>
    <groupId>nl.basjes.parse.useragent</groupId>
    <version>1.2</version>
  </parent>
  <artifactId>yauaa</artifactId>

  <name>Yauaa : - Analyzer</name>
  <description>A parsing an analyzing library to get information from a useragent string.</description>

  <url>http://github.com/nielsbasjes/yauaa</url>

  <properties>
    <jdkLevel>1.7</jdkLevel>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <mainClass>nl.basjes.parse.useragent.debug.Main</mainClass>

    <antlr.version>4.6</antlr.version>
    <hadoop.version>2.7.2</hadoop.version>
    <pig.version>0.16.0</pig.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4-runtime</artifactId>
      <version>${antlr.version}</version>
    </dependency>

    <dependency>
      <groupId>args4j</groupId>
      <artifactId>args4j</artifactId>
        <version>2.33</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>4.3.2.RELEASE</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.4</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <version>4.1</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <version>1.10</version>
    </dependency>

  </dependencies>

  <build>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>version/*</exclude>
        </excludes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <excludes>
            <exclude>UserAgents/*.sh</exclude>
            <exclude>UserAgents/**/*.sh</exclude>
            <exclude>UserAgents/**/*.csv</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>make-super-jar</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/udf.xml</descriptor>
              </descriptors>
              <archive>
                <addMavenDescriptor>true</addMavenDescriptor>
                <manifest>
                  <mainClass>${mainClass}</mainClass>
                </manifest>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>${antlr.version}</version>
        <executions>
          <execution>
            <id>antlr</id>
            <goals>
              <goal>antlr4</goal>
            </goals>
            <configuration>
              <visitor>true</visitor>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <configuration>
          <check/>
          <instrumentation>
            <ignoreTrivial>true</ignoreTrivial>
            <ignores>
              <ignore>nl.basjes.parse.useragent.analyze.InvalidParserConfigurationException</ignore>
              <ignore>org.slf4j.*</ignore>
            </ignores>
            <excludes>
              <!-- Generated class -->
              <exclude>nl/basjes/parse/useragent/Version.class</exclude>
              <!-- Generated by ANTLR4 -->
              <exclude>nl/basjes/parse/useragent/parser/*.class</exclude>
              <!-- Developer debugging tools -->
              <exclude>nl/basjes/parse/useragent/debug/*.class</exclude>
            </excludes>
          </instrumentation>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>maven-replacer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>replace</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <file>src/main/resources/version/Version.java.template</file>
          <outputFile>${basedir}/target/generated-sources/java/nl/basjes/parse/useragent/Version.java</outputFile>
          <replacements>
            <replacement>
              <!--suppress MavenModelInspection -->
              <token>@git.commit.id.describe-short@</token>
              <!--suppress MavenModelInspection -->
              <value>${git.commit.id.describe-short}</value>
            </replacement>
            <replacement>
              <token>@maven.build.timestamp@</token>
              <value>${maven.build.timestamp}</value>
            </replacement>
            <replacement>
              <token>@project.version@</token>
              <value>${project.version}</value>
            </replacement>
          </replacements>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.5.0</version>
        <executions>
          <execution>
            <id>Generate Matchers and Lookups</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>./regen-all.sh</executable>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/java/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Niels Basjes</name>
      <email>niels@basjes.nl</email>
      <roles>
        <role>Architect</role>
        <role>Developer</role>
      </roles>
      <timezone>Europe/Amsterdam</timezone>
    </developer>
  </developers>

  <scm>
    <developerConnection>scm:git:.</developerConnection>
    <connection>https://github.com/nielsbasjes/yauaa.git</connection>
    <url>https://github.com/nielsbasjes/yauaa</url>
  </scm>

</project>
