<?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>

    <parent>
        <groupId>com.spt-development</groupId>
        <artifactId>spt-development-logging-spring-boot</artifactId>
        <version>3.5.3</version>
    </parent>

    <artifactId>spt-development-logging-spring-boot-starter</artifactId>

    <name>logging-spring-boot-starter</name>

    <dependencies>
        <!-- Spring dependencies - version defined in spring-boot bom, import in parent dependencyManagement section -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <!-- SPT dependencies - version defined in parent dependencyManagement section (where omitted) -->
        <dependency>
            <groupId>com.spt-development</groupId>
            <artifactId>spt-development-cid</artifactId>
        </dependency>
        <dependency>
            <groupId>com.spt-development</groupId>
            <artifactId>spt-development-logging-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>com.spt-development</groupId>
            <artifactId>spt-development-logging-spring-boot-autoconfigure</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <!--
                         Disable compilation (and test compilation) as there is no code to compile. Since maven-compiler-plugin 3.12.0,
                         compiling when there is no code has caused the following error (and a similar one for test compilation):

                         Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.0:compile (default-compile) on project <project>: Fatal error compiling:
                         basedir <baseDir>/target/generated-sources/annotations does not exist
                      -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <!-- There are no tests to compile -->
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
                <!-- Version defined in parent pluginManagement section -->
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>parent-enforce</id>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <dependencyConvergence />
                                <requireMavenVersion>
                                    <version>${maven.min.version}</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
                <!-- Version defined in pluginManagement section -->
            </plugin>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
                <!-- Version and configuration etc defined in parent pluginManagement section -->
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <!-- Version and configuration etc defined in parent pluginManagement section -->
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- Additional quality gates not run by default when executing mvn clean verify, but are run by CI pipeline -->
            <id>all-quality-gates</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <!-- Version and configuration etc defined in pluginManagement section -->
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
