<?xml version="1.0"?>
<project
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
        xmlns="http://maven.apache.org/POM/4.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>io.mosip.resident</groupId>
        <artifactId>resident-parent</artifactId>
        <version>1.3.0</version>
    </parent>
    <artifactId>resident-service</artifactId>
    <name>resident-service</name>
    <version>1.3.0</version>
    <properties>
        <commons.packet.manager.version>1.3.0</commons.packet.manager.version>
        <kernel.core.version>1.3.0</kernel.core.version>
        <kernel.virusscanner.clamav.version>1.3.0</kernel.virusscanner.clamav.version>
        <kernel.authcodeflowproxy.api.version>1.3.0</kernel.authcodeflowproxy.api.version>
        <kernel.parent.version>1.3.0</kernel.parent.version>
        <kernel-cbeffutil-api.version>1.3.0</kernel-cbeffutil-api.version>
        <kernel.khazana.version>1.3.0</kernel.khazana.version>
        <kernel-openid-bridge-api.version>1.3.0</kernel-openid-bridge-api.version>
        <maven.jacoco.plugin.version>0.8.11</maven.jacoco.plugin.version>
        <pre-registration-application-service.version>1.3.0</pre-registration-application-service.version>
        <jacoco.maven.plugin.version>0.8.11</jacoco.maven.plugin.version>
        <id-repository-core.version>1.3.0</id-repository-core.version>
        <kernel-websubclient-api.version>1.3.0</kernel-websubclient-api.version>
        <kernel-pdfgenerator.version>1.3.0</kernel-pdfgenerator.version>
        <kernel-ref-idobjectvalidato.version>1.3.0</kernel-ref-idobjectvalidato.version>
        <kernel-auth-adpater.version>1.3.0</kernel-auth-adpater.version>
        <central.publishing.maven.plugin.version>0.7.0</central.publishing.maven.plugin.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.11.2</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-transliteration-icu4j</artifactId>
            <version>${kernel.core.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-openid-bridge-api</artifactId>
            <version>${kernel-openid-bridge-api.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-ref-idobjectvalidator</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-core</artifactId>
            <version>${kernel.core.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-logger-logback</artifactId>
            <version>${kernel.core.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-idvalidator-uin</artifactId>
            <version>${kernel.core.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-idvalidator-rid</artifactId>
            <version>${kernel.core.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-idvalidator-vid</artifactId>
            <version>${kernel.core.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-templatemanager-velocity</artifactId>
            <version>${kernel.core.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-virusscanner-clamav</artifactId>
            <version>${kernel.virusscanner.clamav.version}</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.8.1</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.commons</groupId>
            <artifactId>commons-packet-manager</artifactId>
            <version>${commons.packet.manager.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.mosip.kernel</groupId>
                    <artifactId>kernel-logger-logback</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-afterburner</artifactId>
        </dependency>
        <dependency>
            <groupId>io.mosip.idrepository</groupId>
            <artifactId>id-repository-core</artifactId>
            <version>${id-repository-core.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>
                        spring-boot-starter-security
                    </artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.security</groupId>
                    <artifactId>spring-security-test</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.mosip.kernel</groupId>
                    <artifactId>kernel-auth-adapter</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.mosip.kernel</groupId>
                    <artifactId>kernel-logger-logback</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-dataaccess-hibernate</artifactId>
            <version>${kernel.core.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-authcodeflowproxy-api</artifactId>
            <version>${kernel.authcodeflowproxy.api.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.commons</groupId>
            <artifactId>khazana</artifactId>
            <version>${kernel.khazana.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.mosip.kernel</groupId>
                    <artifactId>kernel-keymanager-service</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-websubclient-api</artifactId>
            <version>${kernel-websubclient-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mvel</groupId>
            <artifactId>mvel2</artifactId>
            <version>2.5.2.Final</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-cbeffutil-api</artifactId>
            <version>${kernel-cbeffutil-api.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.preregistration</groupId>
            <artifactId>pre-registration-application-service</artifactId>
            <version>${pre-registration-application-service.version}</version>
            <classifier>lib</classifier>
            <exclusions>
                <exclusion>
                    <groupId>io.mosip.kernel</groupId>
                    <artifactId>kernel-logger-logback</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>nimbus-jose-jwt</artifactId>
            <version>9.37.2</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-pdfgenerator</artifactId>
            <version>${kernel-pdfgenerator.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.bitbucket.b_c</groupId>
            <artifactId>jose4j</artifactId>
            <version>0.9.4</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>2.6.0</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-auth-adapter</artifactId>
            <version>${kernel-auth-adpater.version}</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${central.publishing.maven.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>ossrh</publishingServerId>
                    <autoPublish>false</autoPublish>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                    <layout>ZIP</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>build-info</goal>
                            <goal>repackage</goal>
                        </goals>
                        <configuration>
                            <attach>false</attach>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <skipTests>false</skipTests>
                    <skip>${configuration-skip}</skip>
                    <argLine>
                        ${argLine} --add-opens=java.base/java.lang=ALL-UNNAMED
                        --add-opens=java.base/java.util=ALL-UNNAMED
                        --add-opens=java.base/java.net=ALL-UNNAMED
                        --add-opens=java.base/java.time=ALL-UNNAMED
                        --add-opens=java.base/java.io=ALL-UNNAMED
                        --add-opens=java.base/java.time.format=ALL-UNNAMED
                        --illegal-access=permit

                    </argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-site</id>
                        <phase>package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>openapi-doc-generate-profile</id>
            <dependencies>
                <dependency>
                    <groupId>io.mosip.kernel</groupId>
                    <artifactId>kernel-auth-adapter</artifactId>
                    <version>1.2.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-webflux</artifactId>
                    <version>2.5.4</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <configuration>
                            <executable>true</executable>
                            <layout>ZIP</layout>
                        </configuration>
                        <executions>
                            <!-- Build info and repackage -->
                            <execution>
                                <id>build-info-repackage</id>
                                <goals>
                                    <goal>build-info</goal>
                                    <goal>repackage</goal>
                                </goals>
                                <configuration>
                                    <attach>false</attach>
                                </configuration>
                            </execution>
                            <!-- Integration test startup -->
                            <execution>
                                <id>pre-integration-test</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                                <configuration>
                                    <folders>
                                        <folder>src/test/resources</folder>
                                    </folders>
                                    <profiles>
                                        <profile>openapi-profile</profile>
                                    </profiles>
                                    <arguments>
                                        <argument>--server.port=8090</argument>
                                        <argument>--server.servlet.path=/app/generic</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <!-- Integration test shutdown -->
                            <execution>
                                <id>post-integration-test</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.springdoc</groupId>
                        <artifactId>springdoc-openapi-maven-plugin</artifactId>
                        <version>0.2</version>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <apiDocsUrl>http://localhost:8090/app/generic/v3/api-docs</apiDocsUrl>
                            <outputFileName>${name}-openapi.json</outputFileName>
                            <outputDir>${project.build.directory}</outputDir>
                            <skip>false</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>pl.project13.maven</groupId>
                        <artifactId>git-commit-id-plugin</artifactId>
                        <version>3.0.1</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}/service-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.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
