<?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.biit-solutions</groupId>
    <artifactId>database-encryptor</artifactId>
    <version>0.2.44</version>
    <name>Database Encryptor</name>
    <description>Basic Classes for encrypting data on database using Hibernate</description>
    <packaging>jar</packaging>

    <parent>
        <groupId>com.biit-solutions</groupId>
        <artifactId>versions</artifactId>
        <version>[0.1,0.2)</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <licenses>
        <license>
            <name>GNU AGPL v3</name>
            <url>https://www.gnu.org/licenses/agpl-3.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>BiiT Sourcing Solutions S.L.</name>
        <url>https://www.biit-solutions.com/</url>
    </organization>

    <distributionManagement>
        <repository>
            <id>central</id>
            <name>Maven Central</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
        <snapshotRepository>
            <id>github</id>
            <name>GitHub Packages</name>
            <url>https://maven.pkg.github.com/BiiT-Solutions/BiiTDatabaseEncryptor</url>
        </snapshotRepository>
    </distributionManagement>


    <scm>
        <connection>scm:git:ssh://git@github.com/BiiT-Solutions/BiiTDatabaseEncryptor.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/BiiT-Solutions/BiiTDatabaseEncryptor.git</developerConnection>
        <url>https://github.com/BiiT-Solutions/BiiTDatabaseEncryptor.git</url>
        <tag>database-encryptor-0.2.44</tag>
    </scm>

    <properties>
        <main.basedir>${project.basedir}</main.basedir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.biit-solutions</groupId>
            <artifactId>cipher</artifactId>
        </dependency>
        <!-- log -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>
        <!-- Spring annotations -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- BCrypt -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-crypto</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Testing -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>database-encryption</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>${maven-scm-provider-gitexe.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <checkModificationExcludes>
                        <checkModificationExclude>pom.xml</checkModificationExclude>
                    </checkModificationExcludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle.version}</version>
                <configuration>
                    <configLocation>${main.basedir}/checkstyle.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <linkXRef>false</linkXRef>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <!-- DUE TO BUG IN SUREFIRE https://twitter.com/fheremans/status/1057214797417271296
                        https://github.com/GoogleCloudPlatform/cloud-opensource-java/pull/201 -->
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <useFile>false</useFile>
                    <trimStackTrace>false</trimStackTrace>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-testng</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <organizationName>BiiT Sourcing Solutions S.L.</organizationName>
                    <inceptionYear>2021</inceptionYear>
                    <licenseName>agpl_v3</licenseName>
                    <excludes>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>