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

    <groupId>com.weedow</groupId>
    <artifactId>schema-org-parent</artifactId>
    <version>0.9.0</version>
    <packaging>pom</packaging>

    <name>schema-org-java-parent</name>
    <description>Java utilities for working with Schema.org data in JSON-LD format</description>
    <url>https://github.com/Kobee1203/schema-org-java</url>

    <scm>
        <tag>0.9.0</tag>
        <url>https://github.com/Kobee1203/schema-org-java</url>
        <connection>scm:git:https://github.com/Kobee1203/schema-org-java.git</connection>
        <developerConnection>scm:git:https://github.com/Kobee1203/schema-org-java.git</developerConnection>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/Kobee1203/schema-org-java/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>Kobee1203</id>
            <name>Nicolas Dos Santos</name>
            <email>Kobee1203@users.noreply.github.com</email>
        </developer>
    </developers>

    <properties>
        <encoding>UTF-8</encoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.compiler.release>${java.version}</maven.compiler.release>

        <!-- Sonar Configuration -->
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.organization>kobee1203</sonar.organization>
        <sonar.projectKey>Kobee1203_schema-org-java</sonar.projectKey>
        <sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
        <sonar.exclusions>**/generated-sources/**</sonar.exclusions>
        <sonar.coverage.exclusions>**/generated-sources/**</sonar.coverage.exclusions>

        <!-- Dependencies -->
        <lombok.version>1.18.38</lombok.version>
        <logback-classic.version>1.5.18</logback-classic.version>
        <jackson.version>2.19.0</jackson.version>
        <handlebars-helpers.version>4.4.0</handlebars-helpers.version>
        <commons-cli.version>1.9.0</commons-cli.version>

        <!-- Test Dependencies -->
        <junit-jupiter-engine.version>5.12.2</junit-jupiter-engine.version>
        <assertj-core.version>3.27.3</assertj-core.version>
        <mockito-junit-jupiter.version>5.17.0</mockito-junit-jupiter.version>
        <equalsverifier.version>3.19.4</equalsverifier.version>
        <to-string-verifier.version>1.4.8</to-string-verifier.version>
        <json-unit-assertj.version>4.1.0</json-unit-assertj.version>
        <system-stubs-jupiter.version>2.1.8</system-stubs-jupiter.version>
        <logcaptor.version>2.11.0</logcaptor.version>
        <inject-resources-junit-jupiter.version>1.0.0</inject-resources-junit-jupiter.version>

        <!-- Plugins -->
        <maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
        <maven-assembly-plugin.version>3.7.1</maven-assembly-plugin.version>
        <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
        <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
        <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
        <maven-jxr-plugin.version>3.6.0</maven-jxr-plugin.version>
        <maven-site-plugin.version>3.21.0</maven-site-plugin.version>
        <maven-project-info-reports-plugin.version>3.9.0</maven-project-info-reports-plugin.version>
        <sonar-maven-plugin.version>5.1.0.4751</sonar-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
        <lombok-maven-plugin.version>1.18.20.0</lombok-maven-plugin.version>
        <nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
        <sign-maven-plugin.version>1.1.0</sign-maven-plugin.version>
    </properties>

    <modules>
        <module>commons</module>
        <module>generator</module>
        <module>maven-plugin</module>
        <module>serializer</module>
        <module>report</module>
        <module>distribution</module>
        <!-- nexus-staging-maven-plugin requires the last module to be not skipped for deployment -->
        <module>dummy-module</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback-classic.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>com.github.jknack</groupId>
                <artifactId>handlebars-helpers</artifactId>
                <version>${handlebars-helpers.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-cli</groupId>
                <artifactId>commons-cli</artifactId>
                <version>${commons-cli.version}</version>
            </dependency>

            <!-- Tests Dependencies -->

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit-jupiter-engine.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit-jupiter-engine.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito-junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>nl.jqno.equalsverifier</groupId>
                <artifactId>equalsverifier</artifactId>
                <version>${equalsverifier.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.jparams</groupId>
                <artifactId>to-string-verifier</artifactId>
                <version>${to-string-verifier.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- https://github.com/lukas-krecan/JsonUnit -->
            <dependency>
                <groupId>net.javacrumbs.json-unit</groupId>
                <artifactId>json-unit-assertj</artifactId>
                <version>${json-unit-assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- https://github.com/webcompere/system-stubs -->
            <dependency>
                <groupId>uk.org.webcompere</groupId>
                <artifactId>system-stubs-jupiter</artifactId>
                <version>${system-stubs-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- https://github.com/Hakky54/log-captor -->
            <dependency>
                <groupId>io.github.hakky54</groupId>
                <artifactId>logcaptor</artifactId>
                <version>${logcaptor.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- https://github.com/hosuaby/inject-resources -->
            <dependency>
                <groupId>io.hosuaby</groupId>
                <artifactId>inject-resources-junit-jupiter</artifactId>
                <version>${inject-resources-junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <release>${maven.compiler.release}</release>
                    <fork>true</fork>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>

            <!-- Code Coverage (Jacoco) -->
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>${sonar-maven-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <!-- Prepares the property pointing to the JaCoCo runtime agent -->
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                    <!-- Ensures that the code coverage report for unit tests is created after unit tests have been run. -->
                    <execution>
                        <id>generate-report</id>
                        <goals>
                            <goal>report</goal>
                            <goal>report-integration</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven-jxr-plugin.version}</version>
                <reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                    <linkJavadoc>true</linkJavadoc>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Attach JAR of sources -->
                    <plugin>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok-maven-plugin</artifactId>
                        <version>${lombok-maven-plugin.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <encoding>UTF-8</encoding>
                            <sourceDirectory>src/main/java</sourceDirectory>
                            <outputDirectory>${project.build.directory}/delombok</outputDirectory>
                            <addOutputDirectory>false</addOutputDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>delombok</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Attach JAR of javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.simplify4u.plugins</groupId>
                        <artifactId>sign-maven-plugin</artifactId>
                        <version>${sign-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ossrh</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>