<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.jetbrains.ktor</groupId>
    <artifactId>tech-empower-framework-benchmark</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>org.jetbrains.ktor tech-empower-framework-benchmark</name>

    <properties>
        <kotlin.version>1.4.0</kotlin.version>
        <ktor.version>1.4.0</ktor.version>
        <serialization.runtime>1.0.0-RC</serialization.runtime>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <hikaricp.version>3.2.0</hikaricp.version>
        <logback.version>1.2.3</logback.version>
        <mysql.version>8.0.18</mysql.version>
        <postgresql.version>42.2.5</postgresql.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlinx</groupId>
            <artifactId>kotlinx-serialization-core</artifactId>
            <version>${serialization.runtime}</version>
        </dependency>

        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-server-netty</artifactId>
            <version>${ktor.version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-server-jetty</artifactId>
            <version>${ktor.version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-server-cio</artifactId>
            <version>${ktor.version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-html-builder</artifactId>
            <version>${ktor.version}</version>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>${hikaricp.version}</version>
        </dependency>

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

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/kotlin</sourceDirectory>

        <plugins>
            <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>
                        <configuration>
                            <languageVersion>1.3</languageVersion>
                            <apiVersion>1.3</apiVersion>
                            <args>
                                <arg>-Xcoroutines=enable</arg>
                            </args>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <compilerPlugins>
                        <plugin>kotlinx-serialization</plugin>
                    </compilerPlugins>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-serialization</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.0.0</version>

                <executions>
                    <execution>
                        <id>cio</id>
                        <goals>
                            <goal>single</goal>
                        </goals>

                        <phase>package</phase>

                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/cio-bundle.xml</descriptor>
                            </descriptors>
                            <archive>
                                <manifest>
                                    <mainClass>io.ktor.server.cio.DevelopmentEngine</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                    <execution>
                        <id>netty</id>
                        <goals>
                            <goal>single</goal>
                        </goals>

                        <phase>package</phase>

                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/netty-bundle.xml</descriptor>
                            </descriptors>
                            <archive>
                                <manifest>
                                    <mainClass>io.ktor.server.netty.DevelopmentEngine</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jetty</id>
                        <goals>
                            <goal>single</goal>
                        </goals>

                        <phase>package</phase>

                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/jetty-bundle.xml</descriptor>
                            </descriptors>
                            <archive>
                                <manifest>
                                    <mainClass>io.ktor.server.jetty.DevelopmentEngine</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>ktor-repo</id>
            <url>https://kotlin.bintray.com/ktor</url>
        </repository>
        <repository>
            <id>jcenter</id>
            <url>https://jcenter.bintray.com/</url>
        </repository>
        <repository>
            <id>bintray-kotlin-kotlinx</id>
            <name>bintray</name>
            <url>https://kotlin.bintray.com/kotlinx</url>
        </repository>
        <repository>
            <id>bintray-kotlin-eap</id>
            <name>bintray</name>
            <url>https://kotlin.bintray.com/kotlin-eap</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>bintray-kotlin-kotlinx-plugins</id>
            <name>bintray-plugins</name>
            <url>https://kotlin.bintray.com/kotlinx</url>
        </pluginRepository>
        <pluginRepository>
            <id>bintray-kotlin-eap</id>
            <name>bintray</name>
            <url>https://kotlin.bintray.com/kotlin-eap</url>
        </pluginRepository>
    </pluginRepositories>

</project>
