<?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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>
    <groupId>travel.wink</groupId>
    <artifactId>google-hotel-apis</artifactId>
    <version>0.0.4</version>
    <packaging>pom</packaging>
    <name>Google Hotel APIs Java</name>
    <description>Java library for Google Hotel APIs schema.</description>

    <developers>
        <developer>
            <id>1</id>
            <name>Bjorn Harvold</name>
            <email>bjorn@wink.travel</email>
            <url>https://wink.travel</url>
            <organization>Wink</organization>
            <roles>
                <role>CTO</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:ssh://github.com:wink-travel/google-hotel-api.git</connection>
        <developerConnection>scm:git:ssh://github.com:wink-travel/google-hotel-api.git</developerConnection>
        <url>https://github.com/wink-travel/google-hotel-api</url>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <java.version>21</java.version>
        <buildnumber.maven.plugin.version>3.2.0</buildnumber.maven.plugin.version>
        <conventional-commits-maven-plugin.version>1.101.0</conventional-commits-maven-plugin.version>
        <git.commit.plugin.version>7.0.0</git.commit.plugin.version>
        <gitflow.maven.plugin>1.19.0</gitflow.maven.plugin>
        <github.release.maven.plugin.version>1.0.7</github.release.maven.plugin.version>
        <jakarta.annotation.version>2.1.1</jakarta.annotation.version>
        <jakarta.xml.bind.api.version>4.0.0</jakarta.xml.bind.api.version>
        <jaxb.maven.plugin.version>4.0.0</jaxb.maven.plugin.version>
        <jsr305.version>3.0.2</jsr305.version>
        <lombok.version>1.18.30</lombok.version>
        <maven.assembly.plugin.version>3.3.0</maven.assembly.plugin.version>
        <maven.clean.plugin.version>3.1.0</maven.clean.plugin.version>
        <maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
        <maven.dependency.plugin.version>3.2.0</maven.dependency.plugin.version>
        <maven.deploy.plugin.version>3.1.1</maven.deploy.plugin.version>
        <maven.gpg.version>3.0.1</maven.gpg.version>
        <maven.javadoc.plugin.version>3.6.3</maven.javadoc.plugin.version>
        <maven.release.plugin.version>3.0.1</maven.release.plugin.version>
        <maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
        <maven.scm.plugin.version>2.0.1</maven.scm.plugin.version>
        <maven.source.plugin.version>3.3.0</maven.source.plugin.version>
        <maven.surefire.plugin.version>3.2.3</maven.surefire.plugin.version>
        <nexus.staging.maven.plugin>1.6.13</nexus.staging.maven.plugin>
        <sonatypeOssDistMgmtSnapshotsUrl>https://s01.oss.sonatype.org/</sonatypeOssDistMgmtSnapshotsUrl>
        <versions.maven.plugin>2.16.2</versions.maven.plugin>
    </properties>

    <modules>
        <module>hint</module>
        <module>hotel-list</module>
        <module>landing-pages</module>
        <module>query</module>
        <module>transaction</module>
    </modules>

    <build>
        <defaultGoal>compile</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jaxb</groupId>
                <artifactId>jaxb-maven-plugin</artifactId>
                <version>${jaxb.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>se.bjurr.gitchangelog</groupId>
                <artifactId>git-changelog-maven-plugin</artifactId>
                <version>${conventional-commits-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>GenerateGitChangelog</id>
                        <phase>none</phase>
                        <goals>
                            <goal>git-changelog</goal>
                        </goals>
                        <configuration>
                            <templateContent>
                                <![CDATA[
:<emoji>: <type>[optional scope]: <description>

[optional body]

[optional footer(s)]
         ]]>
                            </templateContent>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>${maven.scm.plugin.version}</version>
                <configuration>
                    <connectionType>developerConnection</connectionType>
                </configuration>
            </plugin>
            <plugin>
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>
                <version>${git.commit.plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven.deploy.plugin.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus.staging.maven.plugin}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>${sonatypeOssDistMgmtSnapshotsUrl}</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                </configuration>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven.release.plugin.version}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>true</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                    <connectionUrl>${project.scm.developerConnection}</connectionUrl>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.amashchenko.maven.plugin</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <version>${gitflow.maven.plugin}</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions.maven.plugin}</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>${buildnumber.maven.plugin.version}</version>
                <configuration>
                    <shortRevisionLength>7</shortRevisionLength>
                    <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <format>{0,date,yyyyMMdd-HHmmss}-{1}</format>
                    <items>
                        <item>timestamp</item>
                        <item>scmVersion</item>
                    </items>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <fork>true</fork>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <failOnError>false</failOnError>
                    <failOnWarnings>false</failOnWarnings>
                </configuration>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>generate-javadoc-json</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>javadoc-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven.resources.plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/static/docs</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/generated-docs</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.ragedunicorn.tools.maven</groupId>
                <artifactId>github-release-maven-plugin</artifactId>
                <version>${github.release.maven.plugin.version}</version>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <configuration>
                            <owner>wink-travel</owner>
                            <repository>monorepo-java</repository>
                            <server>github-oauth</server>
                            <targetCommitish>master</targetCommitish>
                            <tagName>${project.version}</tagName>
                            <body>See CHANGELOG.md for release notes</body>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

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

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>${sonatypeOssDistMgmtSnapshotsUrl}content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>${jakarta.annotation.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.xml.bind</groupId>
                <artifactId>jakarta.xml.bind-api</artifactId>
                <version>${jakarta.xml.bind.api.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>
