<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>net.odoframework</groupId>
    <artifactId>odo</artifactId>
    <version>0.1.0</version>
    <modules>
        <module>odo-core</module>
        <module>odo-container</module>
        <module>odo-service</module>
        <module>odo-aws-lambda-runtime</module>
        <module>odo-aws-lambda-xray</module>
        <module>odo-sql</module>
        <module>odo-jetty-runtime</module>
        <module>odo-kotlin-dsl</module>
        <module>odo-kotlin-sql-dsl</module>
        <module>odo-kotlin-service-dsl</module>
    </modules>
    <packaging>pom</packaging>

    <name>odo-framework</name>
    <description>Framework for building Serverless applications</description>
    <url>www.odoframework.net</url>

    <developers>
        <developer>
            <name>Julian Exenberger</name>
            <email>jexenberger@gmail.com</email>
            <organization>Private</organization>
            <organizationUrl>www.odoframework.net</organizationUrl>
        </developer>
    </developers>

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

    <scm>
        <connection>scm:git:https://gitlab.com/jexenberger/odo.git</connection>
        <developerConnection>scm:git:https://gitlab.com/jexenberger/odo.git</developerConnection>
        <url>https://gitlab.com/jexenberger/odo.git</url>
    </scm>

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

    <properties>
        <project.scm.id>gitlab</project.scm.id>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <dagger.version>2.33</dagger.version>
        <log4j.version>2.13.0</log4j.version>
        <compiler.plugin.version>3.8.1</compiler.plugin.version>
        <junit.version>5.7.1</junit.version>
        <aws.sdk.version>2.16.29</aws.sdk.version>
        <aws.xray.version>2.4.0</aws.xray.version>
        <aws.lambda.powertools.version>1.5.0</aws.lambda.powertools.version>
        <aspectj.version>1.9.2</aspectj.version>
        <lombok.version>1.18.20</lombok.version>
        <jetty.version>11.0.2</jetty.version>
        <slf4j.version>2.0.0-alpha2</slf4j.version>
        <kotlin.version>1.5.21</kotlin.version>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>${aspectj.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-container</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-service</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-sql</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-aws-lambda-runtime</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-aws-lambda-xray</artifactId>
                <version>${project.version}</version>
            </dependency>


            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-kotlin-dsl</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-kotlin-sql-dsl</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-kotlin-service-dsl</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>net.odoframework</groupId>
                <artifactId>odo-jetty-runtime</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/javax.annotation/jsr305 -->
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>jsr305</artifactId>
                <version>1.0</version>
            </dependency>

            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- lambda powertools -->
            <dependency>
                <groupId>software.amazon.lambda</groupId>
                <artifactId>powertools-tracing</artifactId>
                <version>${aws.lambda.powertools.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.lambda</groupId>
                <artifactId>powertools-logging</artifactId>
                <version>${aws.lambda.powertools.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.lambda</groupId>
                <artifactId>powertools-metrics</artifactId>
                <version>${aws.lambda.powertools.version}</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/com.google.auto.service/auto-service -->
            <dependency>
                <groupId>com.google.auto.service</groupId>
                <artifactId>auto-service</artifactId>
                <version>1.0-rc7</version>
            </dependency>

            <!-- aws -->
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-core</artifactId>
                <version>1.2.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-events</artifactId>
                <version>2.2.9</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-log4j2</artifactId>
                <version>1.2.0</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api -->
            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>5.0.0</version>
            </dependency>

            <!-- jetty -->
            <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-server -->
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
                <version>11.0.2</version>
            </dependency>

            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-servlet</artifactId>
                <version>${jetty.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>2.14.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>2.14.1</version>
            </dependency>


            <!-- example App -->
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>dynamodb-enhanced</artifactId>
                <version>${aws.sdk.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>software.amazon.awssdk</groupId>
                        <artifactId>netty-nio-client</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>software.amazon.awssdk</groupId>
                        <artifactId>apache-client</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>url-connection-client</artifactId>
                <version>${aws.sdk.version}</version>
            </dependency>

            <!-- AWS X-Ray -->


            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-xray-recorder-sdk-aws-sdk-v2</artifactId>
                <version>${aws.xray.version}</version>
            </dependency>

            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-xray-recorder-sdk-aws-sdk-v2-instrumentor</artifactId>
                <version>${aws.xray.version}</version>
            </dependency>

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

            <!-- javax.inject -->
            <!-- https://mvnrepository.com/artifact/javax.inject/javax.inject -->
            <dependency>
                <groupId>jakarta.transaction</groupId>
                <artifactId>jakarta.transaction-api</artifactId>
                <version>2.0.0</version>
            </dependency>
            <dependency>
                <groupId>jakarta.inject</groupId>
                <artifactId>jakarta.inject-api</artifactId>
                <version>2.0.0</version>
            </dependency>

            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.8.6</version>
            </dependency>

            <!-- test -->
            <!-- test -->
            <!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
            <!-- https://mvnrepository.com/artifact/org.hsqldb/hsqldb -->
            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>2.5.1</version>
            </dependency>


            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <!-- this is needed or IntelliJ gives junit.jar or junit-platform-launcher:1.3.2 not found errors -->
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>1.7.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>3.8.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>


        </dependencies>
    </dependencyManagement>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.plugin.version}</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        <arg>-Xlint:all,-processing,-cast,-serial,-try</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                        <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                    </compilerArgs>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <!-- latest version (2.20.1) does not work well with JUnit5 -->
                <version>3.0.0-M5</version>
                <dependencies>

                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jvmTarget>1.8</jvmTarget>
                </configuration>
            </plugin>


        </plugins>


    </build>


    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.ruleoftech</groupId>
                        <artifactId>markdown-page-generator-plugin</artifactId>
                        <version>2.2.0</version>
                        <executions>
                            <execution>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <inputDirectory>${project.basedir}/doc</inputDirectory>
                            <outputDirectory>${project.basedir}/target/doc</outputDirectory>
                            <transformRelativeMarkdownLinks>true</transformRelativeMarkdownLinks>
                            <recursiveInput>true</recursiveInput>
                            <copyDirectories>css,doc/images</copyDirectories>
                            <headerHtmlFile>${project.basedir}/doc/header.html</headerHtmlFile>
                            <pegdownExtensions>TABLES,FENCED_CODE_BLOCKS,HARDWRAPS,EXTANCHORLINKS_WRAP,TOC,
                            </pegdownExtensions>
                        </configuration>

                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.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.3.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-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--batch</arg>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <version>1.5.0</version>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>javadocJar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <dokkaPlugins>
                                <plugin>
                                    <groupId>org.jetbrains.dokka</groupId>
                                    <artifactId>kotlin-as-java-plugin</artifactId>
                                    <version>1.5.0</version>
                                </plugin>
                            </dokkaPlugins>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>