<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>

    <groupId>org.gautelis</groupId>
    <artifactId>muprocessmanager</artifactId>
    <version>1.10</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A library implementing a micro process manager</description>
    <url>http://github.com/FrodeRanders/muprocessmanager</url>

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

    <developers>
        <developer>
            <name>Frode Randers</name>
            <email>frode.randers@gmail.com</email>
            <organizationUrl>https://github.com/FrodeRanders</organizationUrl>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/FrodeRanders/muprocessmanager.git</connection>
        <developerConnection>scm:git:ssh://github.com:FrodeRanders/muprocessmanager.git</developerConnection>
        <url>http://github.com/FrodeRanders/muprocessmanager/tree/master</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <vopn.version>2.3</vopn.version>
        <gson.version>2.8.2</gson.version>
        <derby.version>10.14.1.0</derby.version>
        <commons.io.version>2.6</commons.io.version>
        <commons.lang3.version>3.7</commons.lang3.version>
        <slf4j.version>1.7.25</slf4j.version>
        <log4j.version>2.11.0</log4j.version>
    </properties>

    <dependencies>
        <dependency>
            <!-- https://github.com/FrodeRanders/java-vopn.git -->
            <groupId>org.gautelis</groupId>
            <artifactId>vopn</artifactId>
            <version>${vopn.version}</version>
        </dependency>

        <!-- Parameter serialization -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons.io.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons.lang3.version}</version>
        </dependency>

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

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Database stuff -->
        <dependency>
            <!-- Primarily for testing, but also default database for proc.mgr. -->
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <version>${derby.version}</version>
        </dependency>


        <!-- test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>commons-collections:commons-collections:[3.0,3.2.1]</exclude>
                                        <exclude>commons-collections:commons-collections:4.0</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <maxmem>1024m</maxmem>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <includes>
                                    <include>org.gautelis:vopn</include>
                                    <include>org.apache.derby:derby</include>
                                    <include>commons-dbcp:commons-dbcp</include>
                                    <include>commons-pool:commons-pool</include>
                                    <include>commons-io:commons-io</include>
                                    <include>org.apache.commons:commons-lang3</include>
                                    <include>com.google.code.gson:gson</include>
                                </includes>
                                <excludes>
                                    <!-- jar tf target/muprocessmanager-x.y.jar | egrep '\/$' | sort -->
                                    <exclude>org.jline:jline</exclude>
                                </excludes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                        <exclude>testpool.jocl</exclude>
                                        <exclude>Log4j-*.*</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.coderplus.maven.plugins</groupId>
                <artifactId>copy-rename-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>copy-file</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <!-- The default internal database schema is based on the Derby variant -->
                            <fileSets>
                                <fileSet>
                                    <sourceFile>contrib/derby/database-create.sql</sourceFile>
                                    <destinationFile>src/main/resources/org/gautelis/muprocessmanager/default-database-create.sql</destinationFile>
                                </fileSet>
                                <fileSet>
                                    <sourceFile>contrib/derby/sql-statements.xml</sourceFile>
                                    <destinationFile>src/main/resources/org/gautelis/muprocessmanager/sql-statements.xml</destinationFile>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
