<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>org.digidoc4j.dss</groupId>
		<artifactId>sd-dss</artifactId>
		<version>5.4.d4j.1</version>
	</parent>

	<artifactId>dss-token</artifactId>
	<name>DSS Token</name>
	<description>Token implementations for PKCS11, PKCS12, MsCapi and JKS</description>

	<dependencies>
		<dependency>
			<groupId>${dss.groupId}</groupId>
			<artifactId>dss-model</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	
	<profiles>
		<profile>
            <id>jdk19-plus</id>
            <activation>
                <jdk>[9,)</jdk>
            </activation>
            
            <build>
				<plugins>
		              <plugin>
						<artifactId>maven-compiler-plugin</artifactId>
						<configuration>
							<source>9</source>
							<target>9</target>

	                        <!-- jdk.crypto.cryptoki : SunPKCS11 -->
	                        <compilerArgs>
								<arg>--add-modules</arg>
								<arg>jdk.crypto.cryptoki</arg>
								
								<arg>--add-exports</arg>
								<arg>jdk.crypto.cryptoki/sun.security.pkcs11.wrapper=ALL-UNNAMED</arg>		
														
								<!-- Reflection at runtime -->
								<arg>--add-opens</arg>
								<arg>jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED</arg>
							</compilerArgs>
						</configuration>
					</plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>--add-modules jdk.crypto.cryptoki</argLine>
                        </configuration>
                    </plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
