<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.4.5</version>
		<relativePath /> <!-- lookup parent from repository -->
	</parent>
	<groupId>io.netfoundry</groupId>
	<artifactId>entitlement-management</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>entitlement-management</name>
	<description>Netfoundry entitlement and usage management service</description>
	<properties>
		<java.version>21</java.version>
		<spring-cloud.version>2024.0.1</spring-cloud.version>
		<sonar.projectKey>netfoundry_entitlement-management-service</sonar.projectKey>
		<sonar.organization>netfoundry</sonar.organization>
		<sonar.host.url>https://sonarcloud.io</sonar.host.url>
		<sonar.sources>src/main</sonar.sources>
		<sonar.tests>src/test</sonar.tests>
		<jacoco.version>0.8.11</jacoco.version>
		<flyway.version>11.20.3</flyway.version>
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<sonar.coverage.exclusions>
			**/config/*, **/service/**/*, **/controller/CommonExceptionHandler.java
		</sonar.coverage.exclusions>
		<sonar.cpd.exclusions>
			**/service/core/*
		</sonar.cpd.exclusions>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-hateoas</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-autoconfigure</artifactId>
		</dependency>
		<dependency>
			<!-- Metrics reporting -->
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-registry-elastic</artifactId>
		</dependency>
		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-tracing-bridge-brave</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-validation</artifactId>
		</dependency>

		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- NetFoundry Dependencies -->
		<dependency>
			<groupId>io.netfoundry</groupId>
			<artifactId>common-util-framework</artifactId>
			<version>4.0.0</version>
		</dependency>

		<dependency>
			<groupId>io.netfoundry</groupId>
			<artifactId>authorization</artifactId>
			<version>2.5.0</version>
			<classifier>client</classifier>
		</dependency>

		<dependency>
			<groupId>software.amazon.kinesis</groupId>
			<artifactId>amazon-kinesis-client</artifactId>
			<version>3.1.1</version>
			<exclusions>
   				 <exclusion>
      			 	<groupId>commons-logging</groupId>
     			 	<artifactId>commons-logging</artifactId>
    			</exclusion>
  			</exclusions>
		</dependency>

		<!-- Elastic search REST client -->

		<dependency>
			<groupId>co.elastic.clients</groupId>
			<artifactId>elasticsearch-java</artifactId>
			<version>8.15.0</version>
		</dependency>

		<!-- Spring redis dependencies -->

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-redis</artifactId>
		</dependency>

		<dependency>
			<groupId>redis.clients</groupId>
			<artifactId>jedis</artifactId>
			<version>3.6.0</version>
		</dependency>

		<!-- Flyway dependencies Start-->
		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-core</artifactId>
		</dependency>

		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-mysql</artifactId>
		</dependency>

		<dependency>
			<groupId>io.netfoundry</groupId>
			<artifactId>ziti-java-management-client</artifactId>
			<version>0.18.3</version>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents.client5</groupId>
			<artifactId>httpclient5</artifactId>
		</dependency>

		<dependency>
			<groupId>io.github.resilience4j</groupId>
			<artifactId>resilience4j-circuitbreaker</artifactId>
		</dependency>

		<dependency>
			<groupId>io.github.resilience4j</groupId>
			<artifactId>resilience4j-micrometer</artifactId>
		</dependency>
		
		<dependency>
			<groupId>org.redisson</groupId>
			<artifactId>redisson-spring-boot-starter</artifactId>
			<version>3.31.0</version>
		</dependency>

		<dependency>
			<groupId>net.javacrumbs.shedlock</groupId>
			<artifactId>shedlock-spring</artifactId>
			<version>4.33.0</version>
		</dependency>

		<dependency>
			<groupId>net.javacrumbs.shedlock</groupId>
			<artifactId>shedlock-provider-redis-spring</artifactId>
			<version>4.33.0</version>
		</dependency>

		<dependency>
			<groupId>net.javacrumbs.shedlock</groupId>
			<artifactId>shedlock-provider-jdbc-template</artifactId>
			<version>4.33.0</version>
		</dependency>

		<!-- Scheduler Lock End -->

		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-jsr310</artifactId>
		</dependency>

		<dependency>
			<groupId>com.mysql</groupId>
			<artifactId>mysql-connector-j</artifactId>
			<version>9.3.0</version>
		</dependency>

		<dependency>
			<groupId>net.logstash.logback</groupId>
			<artifactId>logstash-logback-encoder</artifactId>
			<version>6.3</version>
		</dependency>

		<dependency>
      		<groupId>org.slf4j</groupId>
      		<artifactId>jcl-over-slf4j</artifactId>
    	</dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
            <exclusions>
   				 <exclusion>
      			 	<groupId>commons-logging</groupId>
     			 	<artifactId>commons-logging</artifactId>
    			</exclusion>
  			</exclusions>
        </dependency>

	</dependencies>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>
							<groupId>org.projectlombok</groupId>
							<artifactId>lombok</artifactId>
						</exclude>
					</excludes>
				</configuration>
			</plugin>
            <plugin>
			  <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                <includes>
                  <include>**/*Test.java, *Test.java</include>
                </includes>
                <systemPropertyVariables>
                  <org.springframework.restdocs.outputDir>
                    ${project.build.directory}/generated-snippets
                  </org.springframework.restdocs.outputDir>
                  <org.springframework.restdocs.javadocJsonDir>
                    ${project.build.directory}/generated-javadoc-json
                  </org.springframework.restdocs.javadocJsonDir>
                </systemPropertyVariables>
              </configuration>
            </plugin>
			<plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>${jacoco.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>
                <execution>
                  <id>post-unit-test</id>
                  <phase>verify</phase>
                  <goals>
                    <goal>report</goal>
                  </goals>
                  <configuration>
							<!-- Sets the path to the file which contains the executiondata. -->
                    <dataFile>target/jacoco.exec</dataFile>
							<!-- Sets the output directory for the code coverage report. -->
                    <outputDirectory>target/jacoco-ut</outputDirectory>
                  </configuration>
                </execution>
              </executions>
            </plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.sonarsource.scanner.maven</groupId>
					<artifactId>sonar-maven-plugin</artifactId>
					<version>3.10.0.2594</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

  <profiles>
    <profile>
      <id>dependency_check</id>
      <build>
        <plugins>
			<plugin>
				<groupId>org.owasp</groupId>
				<artifactId>dependency-check-maven</artifactId>
				<version>10.0.2</version>
				<configuration>
					<!-- Fail Build On CVSS core more then 8.0 which is HIGH-->
					<!-- <failBuildOnCVSS>8</failBuildOnCVSS> -->
					<!-- Generate all report formats -->
					<format>ALL</format>
					<!-- Don't use Nexus Analyzer -->
					<centralAnalyzerEnabled>false</centralAnalyzerEnabled>
					<!-- Am I the latest version? -->
					<versionCheckEnabled>true</versionCheckEnabled>
					<!--suppression Files -->
					<suppressionFiles>owasp/suppressed-dependencies.xml</suppressionFiles>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>xml-maven-plugin</artifactId>
				<configuration>
					<transformationSets>
						<transformationSet>
							<dir>${project.build.directory}</dir>
							<includes>
								<include>dependency-check-report.xml</include>
							</includes>
							<stylesheet>owasp/dependencycheck_to_pmd.xsl</stylesheet>
							<outputDir>target</outputDir>
							<fileMappers>
								<fileMapper
									implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
									<targetName>dependency-check-report-pmd.xml</targetName>
								</fileMapper>
							</fileMappers>
						</transformationSet>
					</transformationSets>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>net.sf.saxon</groupId>
						<artifactId>saxon</artifactId>
						<version>8.7</version>
					</dependency>
				</dependencies>
			</plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
