<?xml version="1.0"?>
<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>li.strolch</groupId>
    <artifactId>li.strolch</artifactId>
    <version>1.6.101</version>

    <name>li.strolch</name>
    <description>Module build for strolch</description>
    <packaging>pom</packaging>
    <url>http://www.strolch.li</url>
    <inceptionYear>2014</inceptionYear>

    <issueManagement>
        <system>Github Issues</system>
        <url>https://github.com/strolch-li/strolch/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/strolch-li/strolch.git</connection>
        <developerConnection>scm:git:https://github.com/strolch-li/strolch.git</developerConnection>
        <url>https://github.com/strolch-li/strolch</url>
    </scm>

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

    <organization>
        <name>Strolch</name>
        <url>http://www.strolch.li</url>
    </organization>

    <developers>
        <developer>
            <id>eitch</id>
            <name>Robert von Burg</name>
            <email>eitch@eitchnet.ch</email>
            <url>http://www.eitchnet.ch</url>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>msmock</id>
            <name>Martin Smock</name>
            <email>martin.smock@bluewin.ch</email>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>retob</id>
            <name>Reto Breitenmoser</name>
            <email>reto.breitenmoser@4trees.ch</email>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
        <buildTimestamp>${maven.build.timestamp}</buildTimestamp>

        <jdk.version>11</jdk.version>

        <!-- compile time dependencies -->
        <slf4j.version>1.7.30</slf4j.version>
        <logback.version>1.2.3</logback.version>
        <jersey.version>2.34</jersey.version>
        <gson.version>2.8.6</gson.version>
        <hikaricp.version>4.0.3</hikaricp.version>
        <postgresql.version>42.2.20</postgresql.version>
        <antlr.version>4.8-1</antlr.version>
        <annotation.version>1.3.2</annotation.version>
        <activation.version>1.1.1</activation.version>
        <javaxmail.version>1.6.2</javaxmail.version>
        <serverlet.version>4.0.1</serverlet.version>
        <jaxrs.api.version>2.1.1</jaxrs.api.version>
        <jaxrs.ri.version>2.34</jaxrs.ri.version>
        <jaxb.api.version>2.4.0-b180830.0359</jaxb.api.version>
        <jaxws.version>2.3.4</jaxws.version>
        <jaxp.version>1.4.2</jaxp.version>
        <tyrus.version>1.17</tyrus.version>
        <grizzly.version>2.3.35</grizzly.version>
        <websocket.version>1.1</websocket.version>
        <sax.version>2.0.1</sax.version>
        <csv.version>1.8</csv.version>
        <cron.version>1.6.2</cron.version>

        <camel.version>2.25.2</camel.version>
        <hapi.version>2.3</hapi.version>

        <pi4j.version>1.4</pi4j.version>
        <jserialcomm.version>2.6.2</jserialcomm.version>

        <javafx.version>11.0.2</javafx.version>

        <!-- test time dependencies -->
        <junit.version>4.13.1</junit.version>
        <hamcrest.version>2.2</hamcrest.version>

        <!-- maven plug-in dependencies -->
        <maven-scm-plugin.version>1.11.2</maven-scm-plugin.version>
        <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
        <versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-site-plugin.version>3.9.1</maven-site-plugin.version>
        <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-war-plugin.version>3.3.1</maven-war-plugin.version>
        <tomcat7-maven-plugin.version>2.2</tomcat7-maven-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
        <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
        <maven-project-info-reports-plugin.version>3.1.0</maven-project-info-reports-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
        <archetype-packaging.version>3.2.0</archetype-packaging.version>

        <warFinalName>NOT_SET</warFinalName>
        <tomcat7Url>NOT_SET</tomcat7Url>
        <tomcat7ServerId>NOT_SET</tomcat7ServerId>
        <gpg.keyname>NOT_SET</gpg.keyname>

    </properties>

    <modules>
        <module>li.strolch.privilege</module>
        <module>li.strolch.utils</module>
        <module>li.strolch.xmlpers</module>
        <module>li.strolch.model</module>
        <module>li.strolch.soql</module>
        <module>li.strolch.testbase</module>

        <module>li.strolch.persistence.postgresql</module>
        <module>li.strolch.persistence.xml</module>
        <module>li.strolch.agent</module>
        <module>li.strolch.service</module>
        <module>li.strolch.rest</module>
        <module>li.strolch.websocket</module>

        <module>li.strolch.performancetest</module>

        <module>li.strolch.bom</module>
        <module>li.strolch.mvn.archetype.main</module>
        <module>li.strolch.mvn.archetype.webapp</module>

    </modules>

    <dependencyManagement>
        <dependencies>

            <!-- Strolch -->
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.model</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.agent</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.service</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.persistence.xml</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.persistence.postgresql</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.rest</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.utils</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.xmlpers</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.privilege</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.soql</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.testbase</artifactId>
                <version>${project.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Miscellaneous -->
            <dependency>
                <groupId>ch.eitchnet</groupId>
                <artifactId>cron</artifactId>
                <version>${cron.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>${jaxb.api.version}</version>
            </dependency>
            <dependency>
                <groupId>sax</groupId>
                <artifactId>sax</artifactId>
                <version>${sax.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>

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

            <!-- Database -->
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>${hikaricp.version}</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>${postgresql.version}</version>
            </dependency>

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

            <!-- Mail -->
            <dependency>
                <groupId>javax.mail</groupId>
                <artifactId>javax.mail-api</artifactId>
                <version>${javaxmail.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.mail</groupId>
                <artifactId>javax.mail</artifactId>
                <version>${javaxmail.version}</version>
            </dependency>

            <!-- Web -->
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${annotation.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>${serverlet.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.ws.rs</groupId>
                <artifactId>javax.ws.rs-api</artifactId>
                <version>${jaxrs.api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey</groupId>
                <artifactId>jersey-bom</artifactId>
                <version>${jersey.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- websocket -->
            <dependency>
                <groupId>javax.websocket</groupId>
                <artifactId>javax.websocket-api</artifactId>
                <version>${websocket.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions-maven-plugin.version}</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-plugin</artifactId>
                    <version>${maven-scm-plugin.version}</version>
                    <configuration>
                        <tag>${project.artifactId}-${project.version}</tag>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>${buildnumber-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>create</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doCheck>false</doCheck>
                        <doUpdate>false</doUpdate>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <compilerArgument>-Xlint:all</compilerArgument>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                    <configuration>
                        <outputEncoding>UTF-8</outputEncoding>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>${maven-eclipse-plugin.version}</version>
                    <configuration>
                        <downloadJavadocs>true</downloadJavadocs>
                        <downloadSources>true</downloadSources>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</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>${maven-javadoc-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <source>${jdk.version}</source>
                        <doclint>none</doclint>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven-project-info-reports-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>

                                <!-- When creating an executable jar, use copy-dependencies plugin with libs in lib/ dir: -->
                                <!-- mainClass>li.strolch.main.Main</mainClass -->
                                <!-- addClasspath>true</addClasspath -->
                                <!-- classpathPrefix>lib/</classpathPrefix -->
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven-war-plugin.version}</version>
                    <configuration>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                        <warName>${warFinalName}-${project.version}</warName>
                        <webResources>
                            <resource>
                                <directory>src/main/non-packaged-resources</directory>
                                <targetPath>WEB-INF</targetPath>
                                <filtering>true</filtering>
                                <includes>
                                    <include>**/ENV.properties</include>
                                </includes>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>

                <plugin>
                    <!-- Publish to Tomcat7: mvn tomcat7:redeploy -->
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <version>${tomcat7-maven-plugin.version}</version>
                    <configuration>
                        <url>${tomcat7Url}</url>
                        <server>${tomcat7ServerId}</server>
                        <path>/${warFinalName}</path>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.build.directory}/lib</outputDirectory>
                                <overWriteReleases>false</overWriteReleases>
                                <overWriteSnapshots>false</overWriteSnapshots>
                                <overWriteIfNewer>true</overWriteIfNewer>
                                <excludeTransitive>false</excludeTransitive>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <!-- mainClass>li.strolch.main.Main</mainClass -->
                            </manifest>
                        </archive>
                        <!-- <descriptorRefs> -->
                        <!-- <descriptorRef>jar-with-dependencies</descriptorRef> -->
                        <!-- </descriptorRefs> -->
                    </configuration>
                    <!-- <executions> -->
                    <!-- <execution> -->
                    <!-- <id>jar-with-dependencies</id> -->
                    <!-- <phase>package</phase> -->
                    <!-- <goals> -->
                    <!-- <goal>single</goal> -->
                    <!-- </goals> -->
                    <!-- </execution> -->
                    <!-- </executions> -->
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                            <configuration>
                                <keyname>${gpg.keyname}</keyname>
                                <passphraseServerId>${gpg.keyname}</passphraseServerId>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>oss.sonatype.org</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    </configuration>
                    <executions>
                        <execution>
                            <id>deploy-to-sonatype</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>deploy</goal>
                                <goal>release</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>
            <!--
                <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>1.4.5</version>
                <executions>
                <execution>
                <goals>
                <goal>check</goal>
                </goals>
                </execution>
                </executions>
                </plugin>
            -->
        </plugins>

    </build>

    <distributionManagement>
        <repository>
            <id>oss.sonatype.org</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>oss.sonatype.org</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>source</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
