﻿<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<artifactId>test-oces-certificates</artifactId>
	<groupId>dk.nsi.testcertificates</groupId>
	<name>OCES II Certificates for testing Healthcare Services</name>
	<version>1.3</version>

	<properties>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>keytool-maven-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>import</id>
						<goals>
							<goal>importKeystore</goal>
						</goals>
						<phase>process-resources</phase>
						<configuration>
							<destkeystore>${project.build.directory}/validVocesVault.jks</destkeystore>
							<skipIfExist>true</skipIfExist>
							<deststorepass>Test1234</deststorepass>
							<destalias>SOSI:ALIAS_SYSTEM</destalias>
							<srckeystore>src/main/resources/pkcs12/VOCES_gyldig.p12</srckeystore>
							<srcstorepass>Test1234</srcstorepass>
							<srcstoretype>pkcs12</srcstoretype>
							<srcalias>nets danid a/s - tu voces gyldig</srcalias>
						</configuration>
					</execution>
					<execution>
						<id>import2</id>
						<goals>
							<goal>importKeystore</goal>
						</goals>
						<phase>process-resources</phase>
						<configuration>
							<destkeystore>${project.build.directory}/expiredVocesVault.jks</destkeystore>
							<skipIfExist>true</skipIfExist>
							<deststorepass>Test1234</deststorepass>
							<destalias>SOSI:ALIAS_SYSTEM</destalias>
							<srckeystore>src/main/resources/pkcs12/VOCES_udloebet.p12</srckeystore>
							<srcstorepass>Test1234</srcstorepass>
							<srcstoretype>pkcs12</srcstoretype>
							<srcalias>nets danid a/s - udløbet premexp1d1h</srcalias>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>Copy configuration</id>
						<phase>process-classes</phase>
						<configuration>
							<target>
								<copy file="${project.build.directory}/expiredVocesVault.jks"
									todir="${project.build.outputDirectory}/jks" overwrite="true"/>
								<copy file="${project.build.directory}/validVocesVault.jks"
									todir="${project.build.outputDirectory}/jks" overwrite="true"/>
								<!-- Workaround for getting those jks added to remote resources as 
									well -->
								<!-- Copy these jks to resources as temporary resources for later 
									removal, see Remove-temporary-resources below. -->
								<copy file="${project.build.directory}/expiredVocesVault.jks"
									todir="src/main/resources/jks" overwrite="true"/>
								<copy file="${project.build.directory}/validVocesVault.jks"
									todir="src/main/resources/jks" overwrite="true"/>

							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-remote-resources-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<goals>
							<goal>bundle</goal>
						</goals>
						<phase>process-test-resources</phase>
					</execution>
				</executions>
				<configuration>
					<includes>
						<include>**/*.jks</include>
					</includes>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>Remove-temporary-resources</id>
						<phase>prepare-package</phase>
						<configuration>
							<tasks>
								<delete>
									<fileset dir="src/main/resources/jks" includes="expiredVocesVault.jks" />
									<fileset dir="src/main/resources/jks" includes="validVocesVault.jks" />
								</delete>
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.7</version>
				<executions>
					<execution>
						<id>deploy-file</id>
						<phase>deploy</phase>
						<goals>
							<goal>deploy-file</goal>
						</goals>
						<configuration>
							<file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
							<pomFile>pom.xml</pomFile>
							<url>${deploy.repository.url}</url>
							<repositoryId>${deploy.repository.id}</repositoryId>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<!--  Change password in MOCES keystores with: keytool -storepasswd -keystore <jks-file> -->
	<!-- <profiles> <profile> <id>list</id> <activation> <activeByDefault>true</activeByDefault> 
		</activation> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> 
		<artifactId>keytool-maven-plugin</artifactId> <version>1.5</version> <executions> 
		<execution> <id>list</id> <goals> <goal>list</goal> </goals> <configuration> 
		<keystore>${project.build.directory}/validVocesVault.jks</keystore> <storepass>Test1234</storepass> 
		<verbose>true</verbose> <alias>SOSI:ALIAS_SYSTEM</alias> </configuration> 
		</execution> </executions> </plugin> </plugins> </build> </profile> </profiles> -->
</project>
    