<?xml version="1.0" encoding="UTF-8"?>
<!--
	Copyright 2021 Better Ltd (www.better.care)

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
--><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>care.better.platform</groupId>
    <artifactId>web-template</artifactId>
    <version>3.2.2</version>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>WebTemplate implementation for openEHR CDR</description>
    <url>https://github.com/better-care/web-template</url>

    <packaging>jar</packaging>

    <properties>
        <java.version>1.8</java.version>
        <kotlin.version>1.5.30</kotlin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <jetbrains-annotations.version>20.1.0</jetbrains-annotations.version>
        <log4j-api-kotlin.version>1.0.0</log4j-api-kotlin.version>

        <ehr-common.version>3.2.1</ehr-common.version>

        <jackson.version>2.13.4</jackson.version>
        <jakarta.xml.version>2.3.3</jakarta.xml.version>
        <joda-time.version>2.10.8</joda-time.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <commons-io.version>2.8.0</commons-io.version>
        <commons-math3.version>3.6.1</commons-math3.version>
        <assertj.version>3.21.0</assertj.version>
        <jupiter.version>5.8.1</jupiter.version>

        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-dokka-plugin.version>1.5.30</maven-dokka-plugin.version>
        <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-jacoco-plugin.version>0.8.7</maven-jacoco-plugin.version>
        <maven-nexus-staging-plugin.version>1.6.8</maven-nexus-staging-plugin.version>
        <maven-scm-provider-gitexe.version>1.9.5</maven-scm-provider-gitexe.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jetbrains</groupId>
                <artifactId>annotations</artifactId>
                <version>${jetbrains-annotations.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${kotlin.version}</version>
            </dependency>

            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${joda-time.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>${kotlin.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>${jetbrains-annotations.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-model</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-utils</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-time</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-json-jackson</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-terminology</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-xml-jaxb</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-path</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

        <dependency>
            <groupId>care.better.platform</groupId>
            <artifactId>ehr-common-amnode</artifactId>
            <version>${ehr-common.version}</version>
        </dependency>

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

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-kotlin</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>${jakarta.xml.version}</version>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>${jakarta.xml.version}</version>
            <scope>runtime</scope>
        </dependency>

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

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>${commons-math3.version}</version>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${jupiter.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${jupiter.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${jupiter.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
        <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>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <jvmTarget>${java.version}</jvmTarget>
                    <args>
                        <arg>-Xjsr305=strict</arg>
                        <arg>-Xjvm-default=all-compatibility</arg>
                    </args>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-noarg</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-allopen</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <dependencyConvergence />
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

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

    <profiles>
        <profile>
            <id>code-coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${maven-jacoco-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>target/jacoco-report</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>central-release</id>
            <build>
                <plugins>
                    <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-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <version>${maven-dokka-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>javadocJar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourceLinks>
                                <link>
                                    <url>https://github.com/better-care/web-template</url>
                                    <lineSuffix>#L</lineSuffix>
                                </link>
                            </sourceLinks>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${maven-nexus-staging-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </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>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

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

    <scm>
        <connection>scm:git:git://github.com:better-care/web-template.git</connection>
        <developerConnection>scm:git:ssh://github.com:better-care/web-template.git</developerConnection>
        <url>https://github.com/better-care/web-template/tree/master/</url>
    </scm>

    <developers>
        <developer>
            <name>Bostjan Lah</name>
            <email>bostjan.lah@better.care</email>
            <organization>Better Ltd</organization>
            <organizationUrl>https://www.better.care/</organizationUrl>
        </developer>

        <developer>
            <name>Matija Polajnar</name>
            <email>matija.polajnar@better.care</email>
            <organization>Better Ltd</organization>
            <organizationUrl>https://www.better.care/</organizationUrl>
        </developer>

        <developer>
            <name>Primož Delopst</name>
            <email>primoz.delopst@better.care</email>
            <organization>Better Ltd</organization>
            <organizationUrl>https://www.better.care/</organizationUrl>
        </developer>

        <developer>
            <name>Dušan Marković</name>
            <email>dusan.markovic@better.care</email>
            <organization>Better Ltd</organization>
            <organizationUrl>https://www.better.care/</organizationUrl>
        </developer>

        <developer>
            <name>Domen Muren</name>
            <email>domen.muren@better.care</email>
            <organization>Better Ltd</organization>
            <organizationUrl>https://www.better.care/</organizationUrl>
        </developer>

        <developer>
            <name>Matic Ribič</name>
            <email>matic.ribic@better.care</email>
            <organization>Better Ltd</organization>
            <organizationUrl>https://www.better.care/</organizationUrl>
        </developer>
    </developers>

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