<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>jans-auth-client</artifactId>
	<name>jans-auth-client</name>
	<packaging>jar</packaging>

	<parent>
		<groupId>io.jans</groupId>
		<artifactId>jans-auth-server-parent</artifactId>
		<version>2.1.0</version>
	</parent>

	<prerequisites>
		<maven>${maven.min-version}</maven>
	</prerequisites>

	<build>
		<finalName>jans-auth-client</finalName>

		<filters>
			<filter>${basedir}/profiles/${cfg}/config-jans-auth-test-data.properties</filter>
		</filters>

		<testResources>
			<testResource>
				<directory>src/test/resources</directory>
				<filtering>true</filtering>
				<excludes>
					<exclude>jans_test_client_keys.zip</exclude>
				</excludes>
			</testResource>
			<testResource>
				<directory>src/test/resources</directory>
				<filtering>false</filtering>
				<includes>
					<include>jans_test_client_keys.zip</include>
				</includes>
			</testResource>
		</testResources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Multi-Release>true</Multi-Release>
                        </manifestEntries>
                    </archive>
                </configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<argLine>-Xms1024m -Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+DisableExplicitGC</argLine>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.4.1</version>
				<configuration>
					<shadedArtifactAttached>true</shadedArtifactAttached>
					<createDependencyReducedPom>false</createDependencyReducedPom>
					<createSourcesJar>false</createSourcesJar>
				</configuration>
				<executions>
					<execution>
						<id>uber-jar-with-all-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
                            <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
							<finalName>jans-auth-client-jar-with-dependencies</finalName>
							<shadedArtifactId>jans-auth-client-jar-with-dependencies</shadedArtifactId>
							<transformers>
								<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<manifestEntries>
										<mainClass>io.jans.as.client.util.KeyGenerator</mainClass>
									</manifestEntries>
								</transformer>
							</transformers>
							<filters>
								<filter>
									<artifact>*:*</artifact>
									<excludes>
										<exclude>META-INF/*.SF</exclude>
										<exclude>META-INF/*.DSA</exclude>
										<exclude>META-INF/*.RSA</exclude>
										<exclude>META-INF/LICENSE</exclude>
									</excludes>
								</filter>
							</filters>
						</configuration>
					</execution>
					<execution>
						<id>uber-jar-without-crypto-provider</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
                            <shadedClassifierName>jar-without-crypto-provider</shadedClassifierName>
							<finalName>jans-auth-client-jar-without-provider-dependencies</finalName>
							<shadedArtifactId>jans-auth-client-jar-without-provider-dependencies</shadedArtifactId>
							<artifactSet>
								<excludes>
									<exclude>org.bouncycastle:*</exclude>
								</excludes>
							</artifactSet>
							<transformers>
								<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<manifestEntries>
										<mainClass>io.jans.as.client.util.KeyGenerator</mainClass>
									</manifestEntries>
								</transformer>
							</transformers>
							<filters>
								<filter>
									<artifact>*:*</artifact>
									<excludes>
										<exclude>META-INF/*.SF</exclude>
										<exclude>META-INF/*.DSA</exclude>
										<exclude>META-INF/*.RSA</exclude>
										<exclude>META-INF/LICENSE</exclude>
									</excludes>
								</filter>
							</filters>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
		</dependency>
		<dependency>
			<groupId>io.jans</groupId>
			<artifactId>jans-auth-model</artifactId>
		</dependency>
		<!-- RestEasy -->
		<dependency>
			<groupId>org.jboss.resteasy</groupId>
			<artifactId>resteasy-client</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jboss.resteasy</groupId>
			<artifactId>resteasy-jackson2-provider</artifactId>
		</dependency>

		<!-- Jackson -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
		</dependency>

		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
        </dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
		</dependency>

		<!-- Logging -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-1.2-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
		</dependency>

		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk18on</artifactId>
		</dependency>
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcpkix-jdk18on</artifactId>
		</dependency>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
            <scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>htmlunit3-driver</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
		    <groupId>org.apache.commons</groupId>
		    <artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
		    <groupId>org.htmlunit</groupId>
		    <artifactId>htmlunit</artifactId>
			<scope>test</scope>
		</dependency>
        <dependency>
            <groupId>io.jans</groupId>
            <artifactId>jans-auth-test-model</artifactId>
            <scope>test</scope>
        </dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>

        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>test</scope>
        </dependency>

	</dependencies>

	<profiles>
		<profile>
			<id>test-dependencies</id>
			<activation>
				<property>
					<name>maven.test.skip</name>
					<value>false</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>io.jans</groupId>
					<artifactId>jans-auth-model</artifactId>
					<version>${project.version}</version>
					<type>test-jar</type>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
	</profiles>

</project>