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

    <packaging>pom</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.4</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <groupId>io.alapierre</groupId>
    <artifactId>spring-boot-jcr</artifactId>
    <version>1.9</version>

    <scm>
        <connection>scm:git:git://github.com/alapierre/spring-boot-jcr.git</connection>
        <developerConnection>scm:git:git@github.com/alapierre/spring-boot-jcr.git</developerConnection>
        <url>https://github.com/alapierre/spring-boot-jcr</url>
        <tag>1.9</tag>
    </scm>

    <modules>
        <module>spring-boot-jcr-core</module>
        <module>spring-boot-jcr-autoconfigurer</module>
    </modules>

    <properties>
        <jackrabbit-version>2.21.4</jackrabbit-version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <tagNameFormat>@{project.version}</tagNameFormat>
<!--                    <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>-->
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.11.3</version>
                    </dependency>

                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-api</artifactId>
                        <version>1.11.3</version>
                    </dependency>

                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.jackrabbit</groupId>
                <artifactId>jackrabbit-core</artifactId>
                <version>${jackrabbit-version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

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

    <profiles>
        <!-- GPG Signature on release -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
<!--                        <configuration>-->
                            <!-- This is necessary for gpg to not try to use the pinentry programs -->
<!--                            <gpgArguments>-->
<!--                                <arg>&#45;&#45;pinentry-mode</arg>-->
<!--                                <arg>loopback</arg>-->
<!--                            </gpgArguments>-->
<!--                        </configuration>-->
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
