<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

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

    <groupId>dev.tiagocarvalho</groupId>
    <artifactId>swagger-dark-theme-spring-boot-starter</artifactId>
    <version>1.0.5</version>
    <packaging>jar</packaging>

    <name>Swagger Dark Theme Spring Boot Starter</name>
    <description>
        Adds a dark theme and a light/dark toggle button to the springdoc-openapi
        Swagger UI via auto-configuration. Just declare the dependency.
    </description>
    <url>https://github.com/jinkijack/swagger-dark-theme-spring-boot-starter</url>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>jinkijack</id>
            <name>Tiago Carvalho</name>
            <url>https://tiagocarvalho.dev</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/jinkijack/swagger-dark-theme-spring-boot-starter.git</connection>
        <developerConnection>scm:git:git@github.com:jinkijack/swagger-dark-theme-spring-boot-starter.git</developerConnection>
        <url>https://github.com/jinkijack/swagger-dark-theme-spring-boot-starter</url>
    </scm>

    <properties>
        <java.version>21</java.version>
    </properties>

    <dependencies>
        <!-- @AutoConfiguration, @ConditionalOnClass, FilterRegistrationBean -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>4.0.6</version>
            <optional>true</optional>
        </dependency>

        <!-- WebMvcConfigurer, ResourceHandlerRegistry -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>7.0.7</version>
            <optional>true</optional>
        </dependency>

        <!-- ContentCachingResponseWrapper -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>7.0.7</version>
            <optional>true</optional>
        </dependency>

        <!-- Servlet API (Filter, HttpServletRequest/Response) -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <!-- WebSecurityCustomizer (optional: only activates if Spring Security is on the consumer) -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>7.0.6</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>7.0.6</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- -sources.jar (required by Maven Central) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Activated for releases (-Prelease): generates javadoc and GPG-signs
             every artifact. Kept out of the default build so local builds stay fast
             and do not require a GPG key. -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- -javadoc.jar (required by Maven Central) -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- GPG signatures (.asc) for every artifact -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Publishes to Maven Central via the Central Portal API. Declared
                         here (not just in the aggregator pom.xml) because this module
                         does not inherit from the aggregator: it has its own Spring Boot
                         parent. Without this, `deploy` falls back to the plain
                         maven-deploy-plugin, which has no repository to push to. -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.11.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>false</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
