<?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>io.mosip.cacheprovider</groupId>
    <artifactId>cache-provider-redis</artifactId>
    <version>1.3.0-beta.2</version>
    <name>cache-provider-redis</name>
    <description>Cache provider redis of MOSIP</description>
    <url>https://github.com/mosip/mosip-ref-impl</url>
    <licenses>
        <license>
            <name>MPL 2.0</name>
            <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/mosip/mosip-ref-impl.git</connection>
        <developerConnection>scm:git:ssh://github.com:mosip/mosip-ref-impl.git</developerConnection>
        <url>https://github.com/mosip/mosip-ref-impl</url>
        <tag>HEAD</tag>
    </scm>
    <developers>
        <developer>
            <name>Mosip</name>
            <email>mosip.emailnotifier@gmail.com</email>
            <organization>io.mosip</organization>
            <organizationUrl>https://github.com/mosip/mosip-ref-impl</organizationUrl>
        </developer>
    </developers>

    <properties>
        <!-- maven -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <maven.compiler.version>3.8.0</maven.compiler.version>
        <maven.surefire.plugin.version>2.22.0</maven.surefire.plugin.version>
        <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
        <spring-boot-starter-data-redis.version>3.2.3</spring-boot-starter-data-redis.version>
        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
        <git-commit-id-plugin.version>3.0.1</git-commit-id-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <jedis.version>2.9.0</jedis.version>
        <maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.14</nexus-staging-maven-plugin.version>
    </properties>

    <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>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.mosip.kernel</groupId>
                <artifactId>kernel-bom</artifactId>
                <version>1.3.0-beta.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
            <version>${spring-boot-starter-data-redis.version}</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>${jedis.version}</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- assembly-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven-assembly-plugin.version}</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
                 <plugin>                  
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-source-plugin</artifactId>
                  <version>${maven-source-plugin.version}</version>
                  <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-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>${git-commit-id-plugin.version}</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
                    <includeOnlyProperties>
                        <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
                        <includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
                    </includeOnlyProperties>
                    <commitIdGenerationMode>full</commitIdGenerationMode>
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                    <!-- <format>json</format> -->
                </configuration>
            </plugin>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-javadoc-plugin</artifactId>
                  <version>${maven-javadoc-plugin.version}</version>
                  <executions>
                        <execution>
                          <id>attach-javadocs</id>
                          <goals>
                                <goal>jar</goal>
                          </goals>
                        </execution>
                  </executions>
                  <configuration>
                          <doclint>none</doclint>
                  </configuration>
                </plugin>

            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <skipTests>${skipTests}</skipTests>
                    <skip>false</skip>
                    <argLine>
                        ${argLine} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --illegal-access=permit
                    </argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>sonar</id>
            <properties>
                <sonar.sources>.</sonar.sources>
                <sonar.inclusions>src/main/java/**,src/main/resources/**</sonar.inclusions>
                <sonar.exclusions>${sonar.coverage.exclusions}</sonar.exclusions>
                <sonar.host.url>https://sonarcloud.io</sonar.host.url>
            </properties>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>${maven.sonar.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sonar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>
