<?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>org.squashtest.tm</groupId>
    <artifactId>migration-extract-attachment</artifactId>
    <version>16.0.0.IT1</version>
    <name>migration-extract-attachment</name>

    <url>https://www.squashtm.com</url>
    <description>SquashTM attachment migration tool</description>
    <inceptionYear>2018</inceptionYear>

    <organization>
        <name>Henix, henix.com</name>
        <url>https://www.henix.com</url>
    </organization>

    <scm>
        <connection>scm:hg:${project.basedir}</connection>
        <developerConnection>scm:hg:${project.basedir}</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>squash-release-deploy-repo</id>
            <name>Squash releases deployment repo</name>
            <url>${deploy-repo.release.url}</url>
        </repository>
        <snapshotRepository>
          <id>squash-snapshot-deploy-repo</id>
          <name>Squash snapshot deployment repo</name>
          <url>${deploy-repo.snapshot.url}</url>
        </snapshotRepository>      
    </distributionManagement>

    <properties>
        <!-- PROJECT -->
        <revision>16.0.0</revision>
        <sha1/>
        <changelist>-SNAPSHOT</changelist>
        <java.version>25</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- DEPENDENCIES -->
        <spring.boot.version>4.1.1</spring.boot.version> <!-- IMPORTANT: Keep spring-boot-starter-parent version in sync -->
        <commons-io.version>2.22.0</commons-io.version>

        <!-- MAVEN PLUGINS -->
        <ci-friendly.version>1.0.28</ci-friendly.version>
        <google-java-format.version>1.33.0</google-java-format.version>
        <license-maven-plugin.version>5.1.2</license-maven-plugin.version>
        <maven-assembly-plugin.version>3.8.0</maven-assembly-plugin.version>
        <maven-compiler-plugin.version>3.16.0</maven-compiler-plugin.version>
        <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
        <maven-failsafe-plugin.version>3.6.0</maven-failsafe-plugin.version>
        <maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
        <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
        <spotless-maven-plugin.version>3.10.3</spotless-maven-plugin.version>

        <!-- SONAR -->
        <sonar.projectKey>${project.groupId}:${project.artifactId}${env.APPEND_SONAR_PROJECT_KEY}</sonar.projectKey>
        <sonar.projectName>${project.name}${env.APPEND_SONAR_PROJECT_NAME}</sonar.projectName>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>4.1.1</version>
    </parent>

        <dependencies>

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-batch</artifactId>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-log4j2</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
                <optional>true</optional>
            </dependency>

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <scope>provided</scope>
            </dependency>

            <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mariadb.jdbc</groupId>
                <artifactId>mariadb-java-client</artifactId>
                <scope>runtime</scope>
            </dependency>

            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <scope>runtime</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jdbc</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
            </dependency>


        </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <version>${spotless-maven-plugin.version}</version>
                    <configuration>
                        <java>
                            <googleJavaFormat>
                                <version>${google-java-format.version}</version>
                            </googleJavaFormat>
                            <indent>
                                <tabs>true</tabs>
                                <spacesPerTab>2</spacesPerTab>
                            </indent>
                            <indent>
                                <spaces>true</spaces>
                                <spacesPerTab>4</spacesPerTab>
                            </indent>
                            <removeUnusedImports/>
                        </java>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <!-- Spring boot maven plugin, will create a proper manifest witch allow java -jar... or mvn spring-boot:run-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring.boot.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <!-- Std java compiler plugin is configured to compile groovy using groovy-eclipse-compiler -->
                    <release>${java.version}</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <inherited>false</inherited>
                <configuration>
                    <strictCheck>true</strictCheck>
                    <header>src/main/license/header.txt</header>
                    <aggregate>true</aggregate>
                    <properties>
                        <license.copyrightOwner>${project.organization.name}</license.copyrightOwner>
                        <license.yearSpan>${project.inceptionYear}</license.yearSpan>
                    </properties>
                    <excludes>
                        <exclude>**/.hgtags</exclude>
                        <exclude>**/*.log</exclude>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/pom.xml</exclude>
                        <exclude>.m2/**</exclude>
                        <exclude>**/.ci-friendly-pom.xml</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.outbrain.swinfra</groupId>
                <artifactId>ci-friendly-flatten-maven-plugin</artifactId>
                <version>${ci-friendly.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <!-- Ensure proper cleanup. Will run on clean phase-->
                            <goal>clean</goal>
                            <!-- Enable ci-friendly version resolution. Will run on process-resources phase-->
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- Mostly the same as surefire, but used for integration tests -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven-assembly-plugin.version}</version>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/main/assembly/bin.xml</descriptor>
                    </descriptors>

                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
                        <phase>package</phase> <!-- bind to the packaging phase -->
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </pluginRepository>
    </pluginRepositories>

</project>
