<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.kernel</groupId>

	<artifactId>kernel-auditmanager-service</artifactId>
	<version>1.3.0</version>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<!-- maven -->
		<maven.compiler.source>21</maven.compiler.source>
		<maven.compiler.target>21</maven.compiler.target>
		<maven.compiler.version>3.8.0</maven.compiler.version>

		<maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
		<maven.war.plugin.version>3.1.0</maven.war.plugin.version>
		<maven.javadoc.version>3.6.3</maven.javadoc.version>
		<maven-shade-plugin.version>2.3</maven-shade-plugin.version>
		<central.publishing.maven.plugin.version>0.7.0</central.publishing.maven.plugin.version>

		<!-- spring -->
		<kernel.core.version>1.3.0</kernel.core.version>
		<kernel.applicant-type.version>1.3.0</kernel.applicant-type.version>
		<kernel.audit-api.version>1.3.0</kernel.audit-api.version>
		<kernel.logger.version>1.3.0</kernel.logger.version>
		<kernel.auth-adapter.version>1.3.0</kernel.auth-adapter.version>
		<kernel-dataaccess-hibernate-version>1.3.0</kernel-dataaccess-hibernate-version>

		<sonar.coverage.exclusions>**/dto/**,**/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/request/**,**/spi/**,"**/proxy/**","**/AuditManagerBootApplication.java"</sonar.coverage.exclusions>
		<sonar.cpd.exclusions>**/dto/**,**/entity/**,**/config/**</sonar.cpd.exclusions>
	</properties>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.mosip.kernel</groupId>
				<artifactId>kernel-bom</artifactId>
				<version>${kernel.core.version}</version>
				<type>pom</type>
			    <scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>io.mosip.kernel</groupId>
			<artifactId>kernel-core</artifactId>
			<version>${kernel.core.version}</version>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
		</dependency>
		<dependency>
			<groupId>io.mosip.kernel</groupId>
			<artifactId>kernel-auditmanager-api</artifactId>
			<version>${kernel.audit-api.version}</version>
		</dependency>
		<dependency>
			<groupId>io.mosip.kernel</groupId>
			<artifactId>kernel-logger-logback</artifactId>
			<version>${kernel.logger.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-test</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>com.googlecode.json-simple</groupId>
			<artifactId>json-simple</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-jsr310</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
		    <groupId>jakarta.servlet</groupId>
		    <artifactId>jakarta.servlet-api</artifactId>
		    <scope>provided</scope>
		</dependency>
		<dependency>
		    <groupId>org.springdoc</groupId>
		    <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
		    <version>2.5.0</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>3.2.3</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>
              <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.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.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>${maven.javadoc.version}</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}/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>
			</configuration>
		</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>
				<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>
		<scm>
                <connection>scm:git:git://github.com/mosip/audit-manager.git</connection>
                <developerConnection>scm:git:ssh://github.com:mosip/audit-manager.git</developerConnection>
                <url>https://github.com/mosip/audit-manager</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>MOSIP</organization>
			<organizationUrl>https://www.mosip.io</organizationUrl>
		</developer>
	</developers>
		<name>Auditmanager service</name>
		<description>Independant Audit manager service </description>
        <url>https://github.com/mosip/audit-manager</url>
	<profiles>
		<profile>
			<id>openapi-doc-generate-profile</id>
			<dependencies>
				<dependency>
					<groupId>io.mosip.kernel</groupId>
					<artifactId>kernel-auth-adapter</artifactId>
					<version>${kernel.auth-adapter.version}</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>${artifactId}-openapi.json</outputFileName>
							<outputDir>${project.build.directory}</outputDir>
							<skip>false</skip>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	</project>
