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

    <groupId>org.dominokit</groupId>
    <artifactId>domino-doc-tool</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>
    <modelVersion>4.0.0</modelVersion>

    <name>domino-doc-tool</name>

    <description>Internal tool to generate dominokit website docs</description>
    <url>https://github.com/DominoKit/domino-doc-tool</url>

    <organization>
        <name>Dominokit</name>
        <url>https://github.com/DominoKit</url>
    </organization>

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

    <developers>
        <developer>
            <name>Ahmad K. Bawaneh</name>
            <email>akabme@gmail.com</email>
        </developer>
        <developer>
            <name>Rafat J. Al-Barouki</name>
            <email>rafat.albarouki@gmail.com</email>
        </developer>
    </developers>

    <issueManagement>
        <url>https://github.com/DominoKit/domino-doc-tool/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <inceptionYear>2019</inceptionYear>

    <scm>
        <connection>scm:git:https://github.com/DominoKit/domino-doc-tool.git</connection>
        <developerConnection>scm:git:git@github.com:DominoKit/domino-doc-tool.git</developerConnection>
        <url>https://github.com/DominoKit/domino-doc-tool</url>
    </scm>

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

    <properties>
        <snapshot.version>HEAD-SNAPSHOT</snapshot.version>
        <next.release.version>1.0.0</next.release.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>

        <maven.compiler.plugin>3.11.0</maven.compiler.plugin>
        <maven.source.plugin>3.0.1</maven.source.plugin>
        <maven.javadoc.plugin>3.5.0</maven.javadoc.plugin>
        <maven.fmt.plugin>2.9</maven.fmt.plugin>
        <maven.license.plugin>3.0</maven.license.plugin>
        <maven.deploy.plugin>3.0.0-M1</maven.deploy.plugin>

        <maven.nexus.staging.plugin>1.6.8</maven.nexus.staging.plugin>
        <maven.gpg.plugin>1.6</maven.gpg.plugin>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin}</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source.plugin}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin}</version>
                <configuration>
                    <failOnError>false</failOnError>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.coveo</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>${maven.fmt.plugin}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${maven.license.plugin}</version>
                <configuration>
                    <header>LICENSE.header</header>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <skipExistingHeaders>true</skipExistingHeaders>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                    <excludes>
                        <exclude>**/README.md</exclude>
                        <exclude>**/LICENSE</exclude>
                        <exclude>**/LICENSE.header</exclude>
                        <exclude>**/AUTHORS</exclude>
                        <exclude>**/src/test/resources/**</exclude>
                        <exclude>**/src/main/resources/**</exclude>
                        <exclude>**/war</exclude>
                        <exclude>**/pom.xml</exclude>
                        <exclude>**/.flattened-pom.xml</exclude>
                        <exclude>**/gwt-unitcache</exclude>
                    </excludes>
                    <properties>
                        <year>${project.inceptionYear}</year>
                        <name>${project.organization.name}</name>
                    </properties>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven.deploy.plugin}</version>
            </plugin>
            <plugin>
                <groupId>org.dominokit</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <snapshotVersionProperty>snapshot.version</snapshotVersionProperty>
                    <releaseVersionProperty>next.release.version</releaseVersionProperty>
                    <!-- Set to true to immediately bump the development version when creating a release branch -->
                    <commitDevelopmentVersionAtStart>true</commitDevelopmentVersionAtStart>

                    <!-- Which digit to increase in major.minor.patch versioning, the values being 0.1.2 respectively.
                         By default the rightmost number is increased.
                         Pass in the number via parameter or profile to allow configuration,
                         since everything set in the file can't be overwritten via command line -->
                    <versionDigitToIncrement>${bump.digit}</versionDigitToIncrement>

                    <!-- Configure branches -->
                    <gitFlowConfig>
                        <productionBranch>main</productionBranch>
                        <!-- default is develop, but we use development -->
                        <developmentBranch>development</developmentBranch>
                    </gitFlowConfig>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <dependencyConvergence/>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven.gpg.plugin}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                            <configuration>
                                <!-- Prevent `gpg` from using pinentry programs -->
                                <gpgArguments>
                                    <arg>--pinentry-mode</arg>
                                    <arg>loopback</arg>
                                </gpgArguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${maven.nexus.staging.plugin}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.ltgt.gwt.maven</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>${maven.gwt.plugin}</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>production</id>
            <activation>
                <property>
                    <name>ci</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
