<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>io.mosip.authentication</groupId>
        <artifactId>authentication-parent</artifactId>
        <version>1.3.1-rc.1</version>
    </parent>
    <version>1.3.1-rc.1</version>

    <artifactId>authentication-service</artifactId>
    <packaging>jar</packaging>

    <name>authentication-service</name>
    <description>Maven project of MOSIP ID-Authentication Service</description>
    <properties>
    <maven.surefire.plugin.version>2.22.0</maven.surefire.plugin.version>
        <jacoco.maven.plugin.version>0.8.11</jacoco.maven.plugin.version>
        <central.publishing.maven.plugin.version>0.7.0</central.publishing.maven.plugin.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>io.mosip.authentication</groupId>
            <artifactId>authentication-core</artifactId>
            <version>${authentication-core.version}</version>
            <exclusions>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-core</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.authentication</groupId>
            <artifactId>authentication-common</artifactId>
            <version>${authentication-common.version}</version>
            <exclusions>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-annotations</artifactId>
            	</exclusion>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-core</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.authentication</groupId>
            <artifactId>authentication-authtypelockfilter-impl</artifactId>
            <version>${authentication-authtypelockfilter-impl.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.authentication</groupId>
            <artifactId>authentication-hotlistfilter-impl</artifactId>
            <version>${authentication-hotlistfilter-impl.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-pinvalidator</artifactId>
            <version>${kernel-pinvalidator.version}</version>
        </dependency>

        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-templatemanager-velocity</artifactId>
            <version>${kernel-templatemanager-velocity.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>dom4j</groupId>
                    <artifactId>dom4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-dataaccess-hibernate</artifactId>
            <version>${kernel-dataaccess-hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-idgenerator-tokenid</artifactId>
            <version>${kernel-idgenerator-tokenid.version}</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-databind</artifactId>
            	</exclusion>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-core</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
            <exclusions>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-databind</artifactId>
            	</exclusion>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-annotations</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <exclusions>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-databind</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-websubclient-api</artifactId>
            <version>${kernel-websubclient-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>${springdoc.version}</version>
        </dependency>
        <dependency>
        	<groupId>io.mosip.kernel</groupId>
        	<artifactId>kernel-core</artifactId>
        	<version>${kernel-core.version}</version>
        	<exclusions>
        		<exclusion>
        			<groupId>org.springframework.boot</groupId>
        			<artifactId>
        				spring-boot-starter-security
        			</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-databind</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-core</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-annotations</artifactId>
        		</exclusion>
        	</exclusions>
        </dependency>
        <dependency>
        	<groupId>org.springframework.boot</groupId>
        	<artifactId>spring-boot-starter-webflux</artifactId>
        	<exclusions>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-databind</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-core</artifactId>
        		</exclusion>
        	</exclusions>
        </dependency>
        <dependency>
        	<groupId>io.mosip.kernel</groupId>
        	<artifactId>kernel-logger-logback</artifactId>
        	<version>${kernel-logger-logback.version}</version>
        	<exclusions>
        		<exclusion>
        			<groupId>org.springframework.boot</groupId>
        			<artifactId>
        				spring-boot-starter-security
        			</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-databind</artifactId>
        		</exclusion>
        	</exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.biometric.util</groupId>
            <artifactId>biometrics-util</artifactId>
            <version>${kernel-biometrics-util}</version>
            <exclusions>
            	<exclusion>
            		<groupId>com.fasterxml.jackson.core</groupId>
            		<artifactId>jackson-databind</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>
        <dependency>
			<groupId>org.openpnp</groupId>
			<artifactId>opencv</artifactId>
			<version>4.5.3-4</version>
	    </dependency>
        <dependency>
			<groupId>info.weboftrust</groupId>
			<artifactId>ld-signatures-java</artifactId>
			<version>1.0.0</version>
			<exclusions>
				<exclusion>
					<groupId>com.fasterxml.jackson.core</groupId>
					<artifactId>jackson-databind</artifactId>
				</exclusion>
			</exclusions>
        </dependency>
        <dependency>
        	<groupId>com.fasterxml.jackson.module</groupId>
        	<artifactId>jackson-module-jaxb-annotations</artifactId>
        	<exclusions>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-databind</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-core</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-annotations</artifactId>
        		</exclusion>
        	</exclusions>
        </dependency>
        <dependency>
        	<groupId>com.fasterxml.jackson.dataformat</groupId>
        	<artifactId>jackson-dataformat-xml</artifactId>
        	<exclusions>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-databind</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-core</artifactId>
        		</exclusion>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-annotations</artifactId>
        		</exclusion>
        	</exclusions>
        </dependency>
        <dependency>
        	<groupId>io.mosip.kernel</groupId>
        	<artifactId>kernel-openid-bridge-api</artifactId>
        	<version>${kernel-openid-bridge-api.version}</version>
        	<exclusions>
        		<exclusion>
        			<groupId>com.fasterxml.jackson.core</groupId>
        			<artifactId>jackson-databind</artifactId>
        		</exclusion>
        	</exclusions>
        </dependency>
        <dependency>
            <groupId>io.mosip.biosdk</groupId>
            <artifactId>biosdk-client</artifactId>
            <version>${biosdk-client.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.demosdk</groupId>
            <artifactId>demosdk</artifactId>
            <version>${demosdk.version}</version>
        </dependency>
    </dependencies>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://central.sonatype.com/api/v1/publisher</url>
        </repository>
    </distributionManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot-maven-plugin.version}</version>
                <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.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>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>
                <version>${jacoco.maven.plugin.version}</version>
                <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>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <skipTests>false</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>openapi-doc-generate-profile</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <version>${spring-boot-maven-plugin.version}</version>
                        <configuration>
                            <executable>true</executable>
                            <layout>ZIP</layout>
                            <wait>1000</wait>
                            <maxAttempts>180</maxAttempts>
                        </configuration>
                        <executions>
                            <execution>
                                <id>pre-integration-test</id>
                                <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.context-path=/app/generic</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>post-integration-test</id>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                            <execution>
                                <goals>
                                    <goal>build-info</goal>
                                    <goal>repackage</goal>
                                </goals>
                            </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>false</skip>
                            <argLine>
                                ${argLine} --add-opens
                                java.xml/jdk.xml.internal=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>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</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/Id%20Authentication%20Service
                            </apiDocsUrl>
                            <outputFileName>${name}-openapi.json</outputFileName>
                            <outputDir>${project.build.directory}</outputDir>
                            <skip>false</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
