<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>

    <modules>
        <module>tiny-event-sourcing-lib</module>
        <module>tiny-mongo-event-store</module>
        <module>tiny-mongo-event-store-spring-boot-starter</module>
        <module>tiny-event-sourcing-spring-boot-starter</module>
        <module>tiny-event-sourcing-spring-app</module>
    </modules>

    <name>tiny-event-sourcing</name>
    <description>Library for Events Sourcing</description>
    <developers>
        <developer>
            <name>
                Jalal Naghiyev
            </name>
        </developer>
        <developer>
            <name>
                Andrey Sukhovitsky
            </name>
        </developer>
        <developer>
            <name>
                Sevastyan Trutnev
            </name>
        </developer>
    </developers>
    <url>https://github.com/andrsuh/tiny-event-sourcing/tree/master-2.0/tiny-event-sourcing-lib</url>
    <scm><url>https://github.com/andrsuh/tiny-event-sourcing/tree/master-2.0/tiny-event-sourcing-lib</url></scm>
    <licenses><license><name>Apache License 2.0</name></license></licenses>
    <groupId>ru.quipy</groupId>
    <artifactId>tiny-event-sourcing</artifactId>
    <version>2.2.2</version>


    <properties>
        <java.version>11</java.version>
        <git.username>andrsuh</git.username>
        <git.repo>tiny-event-sourcing</git.repo>
        <kotlin.version>1.6.10</kotlin.version>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-kotlin</artifactId>
            <version>2.12.2</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2/</url>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <!-- Нужен для пуша jar в репозиторий libs-snapshot-local в jfrog artifactory -->
            <distributionManagement>
                <snapshotRepository>
                    <id>snapshots</id>
                    <url>http://artifactory:8081/artifactory/libs-snapshot-local</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>github</id>
            <distributionManagement>
                <repository>
                    <id>github</id>
                    <name>GitHub Packages</name>
                    <url>https://maven.pkg.github.com/${git.username}/${git.repo}</url>
                </repository>
                <snapshotRepository>
                    <id>github</id>
                    <name>GitHub Packages</name>
                    <url>https://maven.pkg.github.com/${git.username}/${git.repo}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>

        <profile>
            <id>release</id>
            <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>
            <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</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>default-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>javadoc-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>javadoc</classifier>
                                </configuration>
                            </execution>
                            <execution>
                                <id>sources-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>sources</classifier>
                                </configuration>
                            </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>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <show>public</show>
                                    <failOnError>false</failOnError>
                                    <detectOfflineLinks>false</detectOfflineLinks>
                                    <doclint>all,-missing</doclint>
                                    <nohelp>true</nohelp>
                                    <excludePackageNames>*.internal.*,testutil,demo</excludePackageNames>
                                    <quiet>true</quiet>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <failOnError>false</failOnError>
                        </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>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
