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

    <groupId>de.quinscape.domainql</groupId>
    <artifactId>automaton</artifactId>
    <version>0.6.4</version>

    <name>Automaton</name>
    <description>Opinionated convention-over-configuration / model-based application framework based on DomainQL</description>

    <url>https://github.com/quinscape/automaton/</url>

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

    <developers>
        <developer>
            <name>Sven Helmberger</name>
            <email>sven.helmberger@quinscape.de</email>
            <url>https://www.quinscape.de/</url>
        </developer>
    </developers>

    <inceptionYear>2018</inceptionYear>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>17</java.version>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>de.quinscape.domainql</groupId>
            <artifactId>domainql</artifactId>
            <version>0.3.0</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.svenson</groupId>
            <artifactId>svenson</artifactId>
            <version>1.6.1</version>
        </dependency>

        <dependency>
            <groupId>org.jooq</groupId>
            <artifactId>jooq-codegen</artifactId>
            <version>3.17.7</version>
        </dependency>

        <dependency>
            <groupId>com.graphql-java</groupId>
            <artifactId>graphql-java</artifactId>
            <version>20.0</version>
        </dependency>

        <dependency>
            <groupId>de.quinscape</groupId>
            <artifactId>spring-jsview</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>6.0.0</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>30.1.1-jre</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>6.0.2</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>6.0.4</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>6.0.4</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-websocket</artifactId>
            <version>6.0.4</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>3.0.3</version>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>

        <dependency>
            <groupId>jakarta.validation</groupId>
            <artifactId>jakarta.validation-api</artifactId>
            <version>3.0.2</version>
        </dependency>

        <dependency>
            <groupId>jakarta.persistence</groupId>
            <artifactId>jakarta.persistence-api</artifactId>
            <version>3.1.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>5.2.3</version>
            <optional>true</optional>
        </dependency>


        <!-- Test dependencies -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.6.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.6.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.6.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.25</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <version>3.0.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test-autoconfigure</artifactId>
            <version>3.0.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>6.0.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

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

    <scm>
        <connection>scm:git:https://github.com/quinscape/automaton.git</connection>
        <developerConnection>scm:git:git@github.com:quinscape/automaton.git</developerConnection>
        <url>https://github.com/quinscape/automaton/</url>
        <tag>automaton-0.6.4</tag>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh-qs</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!--
                        Use "@quinscape.de" qualifier for key so we don't always use the default key and developers
                        already using GPG can keep their private key.

                        As-is the key chosen needs to be created with a quinscape mail address.
                    -->
                    <keyname>@quinscape.de</keyname>
                </configuration>
            </plugin>

            <plugin>
                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-release-plugin -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M7</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <goals>deploy</goals>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <compilerArgs>
                        <arg>-parameters</arg>
                        <arg>--add-modules</arg>
                        <arg>java.sql</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <plugin>

                <!-- Specify the maven code generator plugin -->
                <!-- Use org.jooq            for the Open Source Edition
                         org.jooq.pro        for commercial editions,
                         org.jooq.pro-java-6 for commercial editions with Java 6 support,
                         org.jooq.trial      for the free trial edition

                     Note: Only the Open Source Edition is hosted on Maven Central.
                           Import the others manually from your distribution -->
                <groupId>org.jooq</groupId>
                <artifactId>jooq-codegen-maven</artifactId>
                <version>3.17.7</version>

                <!--
                    The generated classes are only used in tests.

                    To update uncomment the <executions>
                    block below and do a "mvn generate-sources" and then comment the block out again.

                    We don't want to require DB access for the tests to run, we only simulate the db activity in the tests.
                    It is however nice to have JOOQ generate the correct classes based on a real DB.
                 -->
                <!--
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                -->

                <!-- Manage the plugin's dependency. In this example, we'll use a PostgreSQL database -->
                <dependencies>
                    <dependency>
                        <groupId>org.postgresql</groupId>
                        <artifactId>postgresql</artifactId>
                        <version>42.5.3</version>
                    </dependency>
                </dependencies>

                <!-- Specify the plugin configuration.
                     The configuration format is the same as for the standalone code generator -->
                <configuration>

                    <!-- JDBC connection parameters -->
                    <jdbc>
                        <driver>org.postgresql.Driver</driver>
                        <url>jdbc:postgresql://localhost/automaton</url>
                        <user>automaton</user>
                        <password>automaton</password>
                    </jdbc>

                    <!-- Generator parameters -->
                    <generator>
                        <database>
                            <name>org.jooq.util.postgres.PostgresDatabase</name>
                            <includes>.*</includes>
                            <excludes />
                            <!-- In case your database supports catalogs, e.g. SQL Server:
                            <inputCatalog>public</inputCatalog>
                              -->
                            <inputSchema>public</inputSchema>
                        </database>
                        <target>
                            <packageName>de.quinscape.automaton.testdomain</packageName>
                            <directory>src/test/java</directory>
                        </target>
                        <generate>
                            <pojos>true</pojos>
                            <records>true</records>
                            <generatedAnnotation>true</generatedAnnotation>
                            <validationAnnotations>true</validationAnnotations>
                            <jpaAnnotations>true</jpaAnnotations>
                            <springAnnotations>true</springAnnotations>
                        </generate>
                        <strategy>
                            <name>
                                de.quinscape.domainql.jooq.DomainObjectGeneratorStrategy
                            </name>
                        </strategy>
                    </generator>
                </configuration>
            </plugin>

            <!-- Update DomainQL type documentation from Java source -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>update-typedocs</id>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <phase>generate-resources</phase>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>de.quinscape.domainql.docs.DocsExtractor</mainClass>
                    <arguments>

                        <argument>--sourceRoot</argument>
                        <argument>${project.basedir}/src/main/java</argument>

                        <!-- Documentation for the standard Automaton logic implementations -->
                        <argument>--package</argument>
                        <argument>de.quinscape.automaton.runtime.logic</argument>

                        <!-- Documentation for automaton base models -->
                        <argument>--package</argument>
                        <argument>de.quinscape.automaton.model</argument>

                        <argument>--output</argument>
                        <argument>${project.basedir}/src/main/resources/automaton-typedocs.json</argument>

                        <argument>--merge</argument>
                        <argument>${project.basedir}/src/main/resources/automaton-types.json</argument>

                        <argument>--pretty</argument>
                    </arguments>
                </configuration>
            </plugin>

            <!-- Junit 5 support -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M8</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M8</version>
            </plugin>
            
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>8.0.2</version>
            </plugin>
        </plugins>
    </build>
</project>

