<?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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.3</version>
    </parent>

    <groupId>de.qaware.tools.collection-cacheable-for-spring</groupId>
    <artifactId>collection-cacheable-for-spring-parent</artifactId>
    <version>1.3.0</version>
    <name>Collection Cacheable for Spring</name>
    <packaging>pom</packaging>
    <description>
        Spring cache extension for putting a whole collection of entities as single cache items
    </description>
    <url>https://github.com/qaware/collection-cacheable-for-spring</url>

    <inceptionYear>2020</inceptionYear>

    <organization>
        <name>QAware GmbH</name>
        <url>https://www.qaware.de</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License v2</name>
            <url>https://opensource.org/licenses/Apache-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/qaware/collection-cacheable-for-spring/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <id>neiser</id>
            <url>https://github.com/neiser</url>
            <name>Andreas Grub</name>
            <email>andreas.grub@qaware.de</email>
            <organization>QAware GmbH</organization>
            <organizationUrl>https://www.qaware.de</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/qaware/collection-cacheable-for-spring.git</connection>
        <developerConnection>scm:git:https://github.com/qaware/collection-cacheable-for-spring.git</developerConnection>
        <url>https://github.com/qaware/collection-cacheable-for-spring</url>
        <tag>master</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <sonar.projectKey>qaware_collection-cacheable-for-spring</sonar.projectKey>
        <sonar.organization>qaware-github</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
        <sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    </properties>

    <modules>
        <module>collection-cacheable-for-spring-api</module>
        <module>collection-cacheable-for-spring-starter</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>de.qaware.tools.collection-cacheable-for-spring</groupId>
                <artifactId>collection-cacheable-for-spring-api</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.7</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.0.0</version>
                    <configuration>
                        <licenseName>apache_v2</licenseName>
                        <organizationName>QAware GmbH</organizationName>
                        <inceptionYear>2020</inceptionYear>
                        <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                        <emptyLineAfterHeader>true</emptyLineAfterHeader>
                        <roots>
                            <root>src/main/java</root>
                        </roots>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>update-license-header</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Disable pushing in the release plugin -->
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <pushChanges>false</pushChanges>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deploy</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <!-- The Base URL of Nexus instance where we want to stage -->
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <!-- The server "id" element from settings to use authentication from,
                                 see build.yml -> "server-id" from actions/setup-java@v1 -->
                            <serverId>ossrh</serverId>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <autoDropAfterRelease>true</autoDropAfterRelease>
                        </configuration>
                    </plugin>

                    <!-- Create sources JAR -->
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Create JavaDoc JAR -->
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Sign artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!--
                                    Prevent gpg from using pinentry programs.
                                    See https://github.com/actions/setup-java#extra-setup-for-pomxml
                                    Fixes: gpg: signing failed: Inappropriate ioctl for device
                                    -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </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>
