<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>com.fortanix</groupId>
	<artifactId>sdkms-jce-provider</artifactId>
	<version>4.13.2147</version>
	<packaging>jar</packaging>

	<name>sdkms-jce-provider</name>
	<url>https://support.fortanix.com</url>
    <description>Fortanix SDKMS JCE Provider</description>

    <scm>
       <connection>scm:https://support.fortanix.com</connection>
       <developerConnection>scm:https://support.fortanix.com</developerConnection>
       <url>scm:https://support.fortanix.com</url>
    </scm>

    <licenses>
      <license>
        <name>Apache License</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        <distribution>repo</distribution>
      </license>
    </licenses>

    <developers>
      <developer>
        <name>Fortanix</name>
        <email>support@fortanix.com</email>
        <organization>Fortanix</organization>
        <organizationUrl>https://support.fortanix.com</organizationUrl>
      </developer>
    </developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
        <sdk.version>4.13.2147</sdk.version>
	</properties>

	<dependencies>
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.15</version>
        </dependency>
		<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
		<dependency>
			<groupId>com.fortanix</groupId>
			<artifactId>sdkms-client</artifactId>
			<version>${sdk.version}</version>
		</dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.13.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.17.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.17.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>2.17.2</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpg-jdk15to18</artifactId>
            <version>1.69</version>
            <scope>test</scope>
        </dependency>
        <dependency>
	    <groupId>com.fortanix.dsm.accelerator</groupId>
	    <artifactId>dsm-accelerator</artifactId>
	    <version>4.13.2147</version>
	</dependency>
	</dependencies>
	<build>
	    <finalName>${project.artifactId}-${project.version}</finalName>
		<plugins>
            <plugin>
               <!-- Configure the project to use java 11 version. -->
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>3.8.1</version>
               <configuration>
                   <compilerArgs>
                        <arg>-proc:none</arg>
                        <arg>--add-exports</arg>
                        <arg>java.base/sun.security.x509=ALL-UNNAMED</arg>
                        <arg>--add-exports</arg>
                        <arg>java.base/sun.security.util=ALL-UNNAMED</arg>
                        <arg>--add-exports</arg>
                        <arg>java.base/sun.security.pkcs=ALL-UNNAMED</arg>
						<arg>--add-modules</arg>
						<arg>java.sql</arg>
                   </compilerArgs>
               </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <argLine>
                        --illegal-access=permit
                    </argLine>
                </configuration>
            </plugin>
            <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-site-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.11.0</version>
            </plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.3</version>
				<executions>
					<execution>
						<id>prepare-agent</id>
						<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>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<!-- Sets the path to the file which contains the execution data. -->

							<dataFile>target/jacoco.exec</dataFile>
							<!-- Sets the output directory for the code coverage report. -->
							<outputDirectory>target/jacoco-ut</outputDirectory>
						</configuration>
					</execution>
				</executions>

			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.2.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<relocations>
								<relocation>
									<pattern>javax.annotation</pattern>
									<shadedPattern>javax.shaded.annotation</shadedPattern>
								</relocation>
							</relocations>
						</configuration>
					</execution>
				</executions>
			</plugin>
                        <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
				<version>2.5.1</version>
				<configuration>
					<groupId>com.fortanix.dsm.accelerator</groupId>
					<artifactId>dsm-accelerator</artifactId>
					<version>4.13.2147</version>
					<packaging>jar</packaging>
					<file>src/main/resources/DSM-Accelerator.jar</file>
					<generatePom>true</generatePom>
				</configuration>
				<executions>
					<execution>
						<id>install-jar-lib</id>
						<goals>
							<goal>install-file</goal>
						</goals>
						<phase>validate</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <reportSets>
					<reportSet>
						<reports>
							<report>report-only</report>
						</reports>
					</reportSet>
				</reportSets>
            </plugin>
        </plugins>
    </reporting>
    <profiles>
		<profile>
			<id>jdk-8</id>
			<properties>
				<maven.compiler.source>1.8</maven.compiler.source>
				<maven.compiler.target>1.8</maven.compiler.target>
			</properties>
			<build>
				<!-- <finalName>${project.artifactId}-${project.version}</finalName> -->
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
						<version>3.8.1</version>
						<configuration>
							<compilerArgs>
								<arg>-proc:none</arg>
							</compilerArgs>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
