<?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">
	<parent>
		<artifactId>plugins</artifactId>
		<groupId>io.jans.jans-config-api.plugins</groupId>
		<version>2.1.0</version>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<artifactId>lock-plugin</artifactId>

	<properties>
		<httpcore.version>4.4.14</httpcore.version>
		<httpclient.version>4.5.13</httpclient.version>
		<jans.version>${project.version}</jans.version>
		
	</properties>

	<dependencies>

		<!-- config api -->
		<dependency>
			<groupId>io.jans</groupId>
			<artifactId>jans-config-api-shared</artifactId>
		</dependency>
		<dependency>
			<groupId>io.jans</groupId>
			<artifactId>jans-config-api-server</artifactId>
		</dependency>
		<dependency>
			<groupId>io.jans</groupId>
			<artifactId>jans-orm-annotation</artifactId>
		</dependency>
		<dependency>
			<groupId>io.jans</groupId>
			<artifactId>jans-core-document-store</artifactId>
		</dependency>
        <dependency>
            <groupId>io.jans</groupId>
            <artifactId>jans-lock-model</artifactId>
            <version>${jans.version}</version>
        </dependency>

		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz</artifactId>
		</dependency>
		<!-- Microprofile -->
		<dependency>
			<groupId>io.smallrye</groupId>
			<artifactId>smallrye-config</artifactId>
			<version>1.5.0</version>
		</dependency>

		<!-- Others -->
		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore-nio</artifactId>
			<version>${httpcore.version}</version>
		</dependency>

		<!-- CDI -->
		<dependency>
			<groupId>jakarta.enterprise</groupId>
			<artifactId>jakarta.enterprise.cdi-api</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.inject</groupId>
			<artifactId>jakarta.inject-api</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.validation</groupId>
			<artifactId>jakarta.validation-api</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.ws.rs</groupId>
			<artifactId>jakarta.ws.rs-api</artifactId>
		</dependency>
	    <dependency>
			<groupId>org.jboss.resteasy</groupId>
			<artifactId>resteasy-multipart-provider</artifactId>
			<version>${resteasy.version}</version>
		</dependency>

		<!-- apache -->
		<dependency>
			<groupId>org.apache.james</groupId>
			<artifactId>apache-mime4j-dom</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.james</groupId>
			<artifactId>apache-mime4j-storage</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.james</groupId>
			<artifactId>apache-mime4j-core</artifactId>
		</dependency>

		<!-- Testing -->
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
		    <scope>test</scope>
		</dependency>

		<!-- Swagger -->
		<dependency>
			<groupId>io.swagger.core.v3</groupId>
			<artifactId>swagger-core-jakarta</artifactId>
		</dependency>


	</dependencies>


	<build>
		<filters>
			<filter>../../profiles/${cfg}/config-build.properties</filter>
			<filter>../../profiles/${cfg}/config-api-test.properties</filter>
		</filters>

		<testResources>
			<testResource>
				<directory>src/test/resources</directory>
				<filtering>true</filtering>
			</testResource>
		</testResources>

		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>**/*.xml</include>
					<include>**/*.properties</include>
					<include>**/*.json</include>
					<include>META-INF/services/*.*</include>
				</includes>
			</resource>
		</resources>


		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>src/main/assembly/assembly.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<suiteXmlFiles>
                        <suiteXmlFile>target/test-classes/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>deploy-to-local-folder</id>
						<phase>package</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>../target/plugins</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}</directory>
									<include>*-distribution.jar</include>
									<filtering>false</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- swagger -->
			<plugin>
				<groupId>io.swagger.core.v3</groupId>
				<artifactId>swagger-maven-plugin-jakarta</artifactId>
				<version>${swagger-maven-plugin-jakarta}</version>
				<executions>
					<execution>
						<configuration>
							<alwaysResolveAppPath>true</alwaysResolveAppPath>
							<outputFileName>lock-plugin-swagger</outputFileName>
							<contextId>${project.artifactId}</contextId>
							<prettyPrint>true</prettyPrint>
							<resourcePackages>
								<package>io.jans.configapi.plugin.lock.rest</package>
							</resourcePackages>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>io.swagger.core.v3</groupId>
						<artifactId>swagger-models-jakarta</artifactId>
						<version>${swagger-models-jakarta}</version>
					</dependency>
				</dependencies>
			</plugin>


		</plugins>
	</build>
</project>