<?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>dev.jcputney</groupId>
    <artifactId>mjml-java-parent</artifactId>
    <version>1.0.1</version>
    <packaging>pom</packaging>

    <name>mjml-java-parent</name>
    <description>Pure Java MJML-to-HTML renderer with zero external dependencies</description>
    <url>https://github.com/jcputney/mjml-java</url>

    <scm>
        <url>${project.url}</url>
        <connection>scm:git:https://github.com/jcputney/mjml-java.git</connection>
        <developerConnection>scm:git:git@github.com:jcputney/mjml-java.git</developerConnection>
        <tag>v1.0.1</tag>
    </scm>

    <developers>
        <developer>
            <id>jcputney</id>
            <name>Jonathan Putney</name>
            <email>jonathan@putney.io</email>
            <url>https://github.com/jcputney</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>mjml-java-core</module>
        <module>mjml-java-resolvers</module>
        <module>mjml-java-spring</module>
        <module>mjml-java-bom</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.release>17</maven.compiler.release>
        <junit.version>6.0.2</junit.version>
        <version.plugin.central-publishing>0.10.0</version.plugin.central-publishing>
        <version.plugin.gpg>3.2.8</version.plugin.gpg>
        <version.plugin.javadoc>3.12.0</version.plugin.javadoc>
        <version.plugin.release>3.3.1</version.plugin.release>
        <version.plugin.source>3.4.0</version.plugin.source>
        <version.plugin.spotbugs>4.9.8.2</version.plugin.spotbugs>
        <version.plugin.spotless>3.2.1</version.plugin.spotless>
        <version.google-java-format>1.34.1</version.google-java-format>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.15.0</version>
                    <configuration>
                        <release>17</release>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.4</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.14</version>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${version.plugin.spotbugs}</version>
                    <configuration>
                        <effort>Max</effort>
                        <threshold>High</threshold>
                        <failOnError>true</failOnError>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${version.plugin.release}</version>
                    <configuration>
                        <arguments>-ntp</arguments>
                        <scmCommentPrefix />
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                        <releaseProfiles>central,sign</releaseProfiles>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${version.plugin.javadoc}</version>
                <configuration>
                    <legacyMode>true</legacyMode>
                    <failOnError>true</failOnError>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${version.plugin.source}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${version.plugin.spotless}</version>
                <configuration>
                    <java>
                        <googleJavaFormat>
                            <version>${version.google-java-format}</version>
                        </googleJavaFormat>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.plugin.gpg}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>github</id>
            <distributionManagement>
                <repository>
                    <id>github</id>
                    <name>GitHub Packages</name>
                    <url>https://maven.pkg.github.com/jcputney/mjml-java</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>central</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${version.plugin.central-publishing}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                            <deploymentName>${project.artifactId}:${project.version}</deploymentName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
