<?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>org.asciidoctor</groupId>
    <artifactId>asciidoctor-maven-tools</artifactId>
    <version>3.0.0</version>
    <packaging>pom</packaging>

    <name>Asciidoctor Maven Tools</name>
    <description>Asciidoctor Maven Plugin and Doxia Module(s) for Maven</description>
    <url>https://github.com/asciidoctor/asciidoctor-maven-plugin</url>

    <organization>
        <name>Asciidoctor</name>
        <url>https://asciidoctor.org/</url>
    </organization>

    <developers>
        <developer>
            <id>lightguard</id>
            <name>Jason Porter</name>
            <email>lightguard.jp@gmail.com</email>
            <url>https://www.lightguard-jp.info</url>
            <roles>
                <role>Project Lead</role>
            </roles>
            <timezone>UTC-7</timezone>
        </developer>
        <developer>
            <id>mojavelinux</id>
            <name>Dan Allen</name>
            <email>dan.j.allen@gmail.com</email>
            <roles>
                <role>Contributor</role>
            </roles>
            <timezone>-7</timezone>
        </developer>
        <developer>
            <id>abelsromero</id>
            <name>Abel Salgado Romero</name>
            <email>abelromero@gmail.com</email>
            <roles>
                <role>Contributor</role>
            </roles>
            <timezone>1</timezone>
        </developer>
    </developers>

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

    <scm>
        <url>scm:git:https://github.com/asciidoctor/asciidoctor-maven-plugin.git</url>
        <connection>scm:git:https://github.com/asciidoctor/asciidoctor-maven-plugin.git</connection>
        <developerConnection>scm:git:https://github.com/asciidoctor/asciidoctor-maven-plugin.git</developerConnection>
        <tag>asciidoctor-maven-tools-3.0.0</tag>
    </scm>

    <issueManagement>
        <url>https://github.com/asciidoctor/asciidoctor-maven-plugin/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.java.version>11</project.java.version>
        <maven.version>3.9.6</maven.version>
        <doxia.version>1.12.0</doxia.version>
        <plexus-component-metadata.version>2.2.0</plexus-component-metadata.version>
        <asciidoctorj.version>2.5.11</asciidoctorj.version>
        <jruby.version>9.4.5.0</jruby.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.25.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>5.10.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.30</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.10.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.8.5</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                    <release>${project.java.version}</release>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                    </configuration>
                </plugin>
                <!-- default plugins for build, if not defined in parent-pom -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.6.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-invoker-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.11</version>
                    <executions>
                        <execution>
                            <id>prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.eluder.coveralls</groupId>
                    <artifactId>coveralls-maven-plugin</artifactId>
                    <version>4.3.0</version>
                    <dependencies>
                        <dependency>
                            <groupId>jakarta.xml.bind</groupId>
                            <artifactId>jakarta.xml.bind-api</artifactId>
                            <version>2.3.3</version>
                        </dependency>
                        <dependency>
                            <groupId>org.glassfish.jaxb</groupId>
                            <artifactId>jaxb-runtime</artifactId>
                            <version>2.3.9</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <!--
              To release, define environment variables:
                export GPG_KEYNAME=""
                export GPG_PASSPHRASE=""
              Then, run
               $ mvn deploy
            -->
            <id>release</id>
            <build>
                <plugins>
                    <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <detectJavaApiLink>false</detectJavaApiLink>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <executable>gpg2</executable>
                            <keyname>${env.GPG_KEYNAME}</keyname>
                            <passphrase>${env.GPG_PASSPHRASE}</passphrase>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>asciidoctorj-snapshot</id>
            <properties>
                <asciidoctorj.version>1.5.1-SNAPSHOT</asciidoctorj.version>
            </properties>
            <repositories>
                <repository>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <id>central-bintray</id>
                    <name>bintray</name>
                    <url>http://dl.bintray.com/lordofthejars/maven</url>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>run-its</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <configuration>
                            <projectsDirectory>src/it</projectsDirectory>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <pomIncludes>
                                <pomInclude>*/pom.xml</pomInclude>
                            </pomIncludes>
                            <preBuildHookScript>setup</preBuildHookScript>
                            <postBuildHookScript>validate</postBuildHookScript>
                            <showErrors>true</showErrors>
                            <debug>true</debug>
                            <!-- <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>-->
                            <!-- <settingsFile>src/it/settings.xml</settingsFile>-->
                            <goals>
                                <goal>clean</goal>
                                <goal>process-sources</goal>
                            </goals>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>install</goal>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

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

    <modules>
        <module>asciidoctor-maven-plugin</module>
        <module>asciidoctor-converter-doxia-module</module>
        <module>asciidoctor-parser-doxia-module</module>
        <module>asciidoctor-maven-commons</module>
    </modules>

</project>
