<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2011-2026 Lime Mojito Pty Ltd
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  ~
  -->

<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>
    <name>${project.artifactId}</name>

    <artifactId>spring-boot-development</artifactId>
    <packaging>pom</packaging>
    <description>Builds a standard boot container. Need to supply source layout and set packaging to jar.</description>

    <parent>
        <groupId>com.limemojito.oss.standards</groupId>
        <artifactId>jar-development</artifactId>
        <version>17.0.7</version>
        <relativePath>../jar-development</relativePath>
    </parent>

    <properties>
        <!-- Build system excludes for configuration files -->
        <coverage.exclude.build.pattern.1>*Application</coverage.exclude.build.pattern.1>
        <coverage.exclude.build.pattern.2>*Configuration</coverage.exclude.build.pattern.2>
        <coverage.exclude.build.pattern.3>*Conf</coverage.exclude.build.pattern.3>
    </properties>

    <!-- include with all builds -->
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.limemojito.oss.standards</groupId>
            <artifactId>json-utilities</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- call the ant plugin for localstack integration testing support.  Configuration in standards poms. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-jar</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                    <execution>
                        <id>start-boot</id>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <phase>pre-integration-test</phase>
                        <configuration>
                            <!-- 120 second start with 500ms waits -->
                            <wait>500</wait>
                            <maxAttempts>240</maxAttempts>
                            <skip>${skipITs}</skip>
                            <profiles>test,integration-test</profiles>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-boot</id>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                        <phase>post-integration-test</phase>
                        <configuration>
                            <skip>${skipITs}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>build-info</id>
                        <goals>
                            <goal>build-info</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>fast-build</id>
            <properties>
                <boot.skip.start>true</boot.skip.start>
            </properties>
        </profile>
    </profiles>
</project>
