<?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>com.github.starnowski.posmulten.hibernate</groupId>
    <artifactId>parent</artifactId>
    <version>0.1.0</version>
    <modules>
        <module>core</module>
        <module>test-utils</module>
        <module>core-functional-tests</module>
    </modules>
    <packaging>pom</packaging>

    <properties>
        <org.hibernate.hibernate.core.version>5.6.3.Final</org.hibernate.hibernate.core.version>
        <com.github.starnowski.posmulten.postgresql.core.version>0.5.3</com.github.starnowski.posmulten.postgresql.core.version>
        <org.projectlombok.lombok.version>1.16.20</org.projectlombok.lombok.version>
        <org.codehaus.groovy.groovy-all.version>2.4.12</org.codehaus.groovy.groovy-all.version>
        <spock.core.version>1.1-groovy-2.4</spock.core.version>
        <org.postgresql.postgresql.version>42.3.3</org.postgresql.postgresql.version>
        <org.testng.testng.version>7.1.0</org.testng.testng.version>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <org.objenesis.objenesis.version>3.2</org.objenesis.objenesis.version>
        <org.mockito.mockito-inline.version>4.4.0</org.mockito.mockito-inline.version>
        <license.dir>${basedir}</license.dir>
    </properties>

    <name>posmulten-hibernate</name>
    <description>
        Integration of Posmulten and Hibernate libraries
    </description>
    <url>https://github.com/starnowski/posmulten-hibernate</url>

    <licenses>
        <license>
            <name>LGPL 2.1</name>
            <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Szymon Tarnowski</name>
            <url>www.linkedin.com/in/szymon-tarnowski-a104b4150</url>
        </developer>
    </developers>

    <issueManagement>
        <url>https://github.com/starnowski/posmulten-hibernate/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <scm>
        <url>https://github.com/starnowski/posmulten-hibernate</url>
        <connection>scm:git:git://github.com/starnowski/posmulten-hibernate.git</connection>
    </scm>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>cobertura</report>
                        </reports>
                    </reportSet>
                </reportSets>

            </plugin>
        </plugins>
    </reporting>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${org.hibernate.hibernate.core.version}</version>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>com.github.starnowski.posmulten</groupId>
                <artifactId>postgresql-core</artifactId>
                <version>${com.github.starnowski.posmulten.postgresql.core.version}</version>
            </dependency>
            <!-- tests dependencies -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${org.projectlombok.lombok.version}</version>
                <optional>true</optional>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>${org.codehaus.groovy.groovy-all.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>${spock.core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${org.testng.testng.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <optional>true</optional>
                <version>${org.postgresql.postgresql.version}</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
<!--                TODO Add property-->
                <version>3.16.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.objenesis</groupId>
                <artifactId>objenesis</artifactId>
                <version>${org.objenesis.objenesis.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>${org.mockito.mockito-inline.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>ossrh</id>
            <properties>
                <gpg.executable>gpg</gpg.executable>
                <gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
                <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
            </properties>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <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>
                            <!-- Prevent gpg from using pinentry programs -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>2.8.2</version>
                        <configuration>
                            <deployAtEnd>true</deployAtEnd>
                        </configuration>
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>maven-central-deploy</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>maven-central-starnowski-posmulten-hibernate</id>
                    <name>starnowski-posmulten-hibernate</name>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                </repository>
            </repositories>
            <distributionManagement>
                <repository>
                    <id>maven-central-starnowski-posmulten-hibernate</id>
                    <name>starnowski-posmulten-hibernate</name>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                    <configuration>
                        <check />
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                        <aggregate>true</aggregate>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>check</goal>
                                <goal>cobertura</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila.maven-license-plugin</groupId>
                    <artifactId>maven-license-plugin</artifactId>
                    <version>1.10.b1</version>
                    <configuration>
                        <header>${license.dir}/license.txt</header>
                        <properties>
                            <project>${project.name}</project>
                            <founder>${project.organization.name}</founder>
                            <year>${project.inceptionYear}</year>
                        </properties>
                        <includes>
                            <include>src/main/java/**</include>
                        </includes>
                        <excludes>
                            <exclude>**/package-info.java</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>format</goal>
                            </goals>
                            <phase>process-sources</phase>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>com.mycila</groupId>
                            <artifactId>licenses</artifactId>
                            <version>1</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>