<?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>de.fraunhofer.iosb.ilt.FROST-Server</groupId>
        <artifactId>FROST-ServerParent</artifactId>
        <version>2.7.2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>FROST-Server.Util</artifactId>
    <packaging>jar</packaging>

    <name>FROST-Server.Util</name>
    <description>Generic utility classes.</description>
    <url>https://github.com/FraunhoferIOSB/FROST-Server</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <root.basedir>${project.parent.basedir}</root.basedir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>de.grundid.opendatalab</groupId>
            <artifactId>geojson-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>net.time4j</groupId>
            <artifactId>time4j-base</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <configuration>
                    <url>https://repo1.maven.org/maven2/org/congocc/org.congocc.parser.generator/${version.congocc}/org.congocc.parser.generator-${version.congocc}.jar</url>
                    <unpack>false</unpack>
                    <outputDirectory>${settings.localRepository}/org/congocc/org.congocc.parser.generator/${version.congocc}/</outputDirectory>
                    <sha512>${congocc.sha512}</sha512>
                    <alwaysVerifyChecksum>true</alwaysVerifyChecksum>
                </configuration>
                <executions>
                    <execution>
                        <id>fetch-files</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <phase>initialize</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generatePathParser</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <executable>java</executable>
                            <workingDirectory>${basedir}</workingDirectory>
                            <arguments>
                                <argument>-jar</argument>
                                <argument>${settings.localRepository}/org/congocc/org.congocc.parser.generator/${version.congocc}/org.congocc.parser.generator-${version.congocc}.jar</argument>
                                <argument>-n</argument>
                                <argument>src/main/congocc/pathParser.ccc</argument>
                                <argument>-d</argument>
                                <argument>${project.build.directory}/generated-sources/congocc/</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generateQueryParser</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <executable>java</executable>
                            <workingDirectory>${basedir}</workingDirectory>
                            <arguments>
                                <argument>-jar</argument>
                                <argument>${settings.localRepository}/org/congocc/org.congocc.parser.generator/${version.congocc}/org.congocc.parser.generator-${version.congocc}.jar</argument>
                                <argument>-n</argument>
                                <argument>src/main/congocc/queryParser.ccc</argument>
                                <argument>-d</argument>
                                <argument>${project.build.directory}/generated-sources/congocc/</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generateWktParser</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <executable>java</executable>
                            <workingDirectory>${basedir}</workingDirectory>
                            <arguments>
                                <argument>-jar</argument>
                                <argument>${settings.localRepository}/org/congocc/org.congocc.parser.generator/${version.congocc}/org.congocc.parser.generator-${version.congocc}.jar</argument>
                                <argument>-n</argument>
                                <argument>src/main/congocc/wktParser.ccc</argument>
                                <argument>-d</argument>
                                <argument>${project.build.directory}/generated-sources/congocc/</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/congocc</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
