<?xml version="1.0" encoding="UTF-8"?>
<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>io.redlink.nlp</groupId>
        <artifactId>redlink-nlp</artifactId>
        <version>2.0.0-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>

    <artifactId>duckling-time</artifactId>
    <name>Duckling Time Parser</name>

    <properties>
        <duckling.version>0.4.0</duckling.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>wit</groupId>
                <artifactId>duckling</artifactId>
                <version>${duckling.version}</version>
            </dependency>
            <dependency>
                <!-- There's an error in the version referenced by duckling -->
                <groupId>prismatic</groupId>
                <artifactId>plumbing</artifactId>
                <version>0.5.3</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>io.redlink.nlp</groupId>
            <artifactId>nlp-model</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>wit</groupId>
            <artifactId>duckling</artifactId>
        </dependency>

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

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <!-- this is a dirty hack around ducklings usage of the ClassLoader -->
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-language-rules</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>wit</groupId>
                                    <artifactId>duckling</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <includes>languages/*/rules/*.clj</includes>
                            <!-- we use our own custom models for German -->
                            <excludes>languages/de/rules/*.clj</excludes>
                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>io.redlink.nlp.time.duckling.DucklingTest</mainClass>
                    <classpathScope>test</classpathScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>