<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>

    <artifactId>microstream-integrations-spring-boot3</artifactId>
    <url>https://microstream.one</url>

    <parent>
        <groupId>one.microstream</groupId>
        <artifactId>microstream-integrations-parent</artifactId>
        <version>08.00.00-MS-GA</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <org.springframework.boot.version>3.0.0</org.springframework.boot.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
            <version>${org.springframework.boot.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>${org.springframework.boot.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <version>${org.springframework.boot.version}</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>one.microstream</groupId>
            <artifactId>microstream-storage-embedded</artifactId>
            <version>08.00.00-MS-GA</version>
        </dependency>
        <dependency>
            <groupId>one.microstream</groupId>
            <artifactId>microstream-storage-embedded-configuration</artifactId>
            <version>08.00.00-MS-GA</version>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.1</version>
                    <configuration>
                        <compilerArgs>
                            <arg>-parameters</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <trimStackTrace>false</trimStackTrace>
                    <statelessTestsetReporter
                            implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
                        <usePhrasedFileName>true</usePhrasedFileName>
                        <usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
                        <usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
                        <usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
                    </statelessTestsetReporter>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-files-exist</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <rules>
                                <requireFilesExist>
                                    <message>File: '/target/classes/META-INF/spring-configuration-metadata.json' is not present</message>
                                    <files>
                                        <file>
                                            ${project.basedir}/target/classes/META-INF/spring-configuration-metadata.json
                                        </file>
                                    </files>
                                </requireFilesExist>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>run-its</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <debug>true</debug>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <pomIncludes>
                                <pomInclude>**/pom.xml</pomInclude>
                            </pomIncludes>
                            <postBuildHookScript>verify</postBuildHookScript>
                            <localRepositoryPath>${project.build.directory}/local-repo
                            </localRepositoryPath>
                            <settingsFile>src/it/settings.xml</settingsFile>
                            <addTestClassPath>true</addTestClassPath>
                            <parallelThreads>5</parallelThreads>
                        </configuration>
                        <executions>
                            <execution>
                                <id>runOneTestToSetupRepoAndAvoidConcurrentDownloads</id>
                                <goals>
                                    <goal>install</goal>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <pomIncludes>
                                        <pomInclude>**/core-config/pom.xml</pomInclude>
                                    </pomIncludes>
                                    <parallelThreads>1</parallelThreads>
                                </configuration>
                            </execution>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
