<?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.commons</groupId>
    <artifactId>commons-packet-service</artifactId>
    <version>1.2.0</version>
    <name>commons-packet-service</name>
    <description>Mosip commons project </description>
    <url>https://github.com/mosip/commons</url>
 <properties>
        <!-- maven -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.version>3.8.0</maven.compiler.version>
        <!-- <maven.surefire.plugin.version>2.22.0</maven.surefire.plugin.version> -->
        <maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
        <maven.war.plugin.version>3.1.0</maven.war.plugin.version>
        <!-- <maven.jacoco.plugin.version>0.8.1</maven.jacoco.plugin.version> -->
        <!-- <maven.sonar.plugin.version>3.7.0.1746</maven.sonar.plugin.version> -->
        <maven.javadoc.version>3.2.0</maven.javadoc.version>
        <maven-shade-plugin.version>2.3</maven-shade-plugin.version>

        <!-- spring -->
        <spring.boot.version>2.0.2.RELEASE</spring.boot.version>
        <spring.data.jpa.version>2.0.7.RELEASE</spring.data.jpa.version>
        <spring-cloud-config.version>2.0.0.RELEASE</spring-cloud-config.version>
        <h2.version>1.4.197</h2.version>
        <jackson.datatype.version>2.9.8</jackson.datatype.version>
        <kernel.keygenerator.bouncycastle.version>1.2.0</kernel.keygenerator.bouncycastle.version>
        <swagger.version>2.9.2</swagger.version>
        <powermock.beta.version>2.0.7</powermock.beta.version>

        <kernel.core.version>1.2.0</kernel.core.version>
        <kernel.biometrics.api.version>1.2.0</kernel.biometrics.api.version>
        <kernel.crypto-jce.version>1.2.0</kernel.crypto-jce.version>
        <kernel.auth.adaptor.version>1.2.0</kernel.auth.adaptor.version>
        <kernel-dataaccess-hibernate.version>1.2.0</kernel-dataaccess-hibernate.version>
        <kernel.logger.logback.version>1.2.0</kernel.logger.logback.version>
        <spring.boot.co>2.0.2.RELEASE</spring.boot.co>
        <khazana.version>1.2.0</khazana.version>
        <sonar.coverage.exclusions>**/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/dto/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/security/**,**/*Config.java,**/*BootApplication.java,**/*VertxApplication.java,**/cbeffutil/**,**/*Utils.java,**/*Validator.java,**/*Helper.java,**/verticle/**,**/VidWriter.java/**,**/masterdata/utils/**,**/spi/**,**/core/http/**,"**/LocationServiceImpl.java","**/RegistrationCenterMachineServiceImpl.java","**/RegistrationCenterServiceImpl.java","**/pridgenerator/**","**/idgenerator/prid","**/proxy/**","**/cryptosignature/**"</sonar.coverage.exclusions>
        <sonar.cpd.exclusions>**/dto/**,**/entity/**,**/config/**</sonar.cpd.exclusions>
        <packet.manager.version>1.2.0</packet.manager.version>
        <springdoc.version>1.5.10</springdoc.version>
 </properties>

    <dependencies>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-core</artifactId>
            <version>${kernel.core.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>
        <dependency>
            <groupId>io.mosip.commons</groupId>
            <artifactId>commons-packet-manager</artifactId>
            <version>${packet.manager.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${swagger.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${swagger.version}</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>${h2.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
            <version>1.8.22</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.mosip.kernel</groupId>
            <artifactId>kernel-logger-logback</artifactId>
            <version>${kernel.logger.logback.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>${springdoc.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-webmvc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>


<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> 
        <build>
<plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring.boot.version}</version>
                <configuration>
                    <executable>true</executable>
                    <layout>ZIP</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>build-info</goal>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>lib</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
           
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>2.8.1</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>1.6.7</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-source-plugin</artifactId>
                  <inherited>true</inherited>
                  <version>2.2.1</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-javadoc-plugin</artifactId>
                  <version>3.2.0</version>
                  <executions>
                        <execution>
                          <id>attach-javadocs</id>
                          <goals>
                                <goal>jar</goal>
                          </goals>
                        </execution>
                  </executions>
                  <configuration>
                          <doclint>none</doclint>
                  </configuration>
                </plugin>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <version>1.5</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>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}/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>
          </plugins>
        </build>
		<scm>
                <connection>scm:git:git://github.com/mosip/packet-manager.git</connection>
                <developerConnection>scm:git:ssh://github.com:mosip/packet-manager.git</developerConnection>
                <url>https://github.com/mosip/commons</url>
                <tag>HEAD</tag>
        </scm>
		<licenses>
          <license>
                <name>MPL 2.0</name>
                <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
          </license>
        </licenses>
		<developers>
                <developer>
                  <name>Mosip</name>
                  <email>mosip.emailnotifier@gmail.com</email>
                  <organization>io.mosip</organization>
                  <organizationUrl>https://github.com/mosip/commons</organizationUrl>
                </developer>
        </developers>
    <profiles>
        <profile>
            <id>openapi-doc-generate-profile</id>
            <dependencies>
                <dependency>
                    <groupId>io.mosip.kernel</groupId>
                    <artifactId>kernel-auth-adapter</artifactId>
                    <version>${project.version}</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>
                        <version>${spring.boot.version}</version>
                        <configuration>
                            <executable>true</executable>
                            <layout>ZIP</layout>
                        </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.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.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>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
