<?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>

    <groupId>io.jans.jans-config-api.plugins</groupId>
    <artifactId>admin-ui-plugin</artifactId>

    <dependencies>
        <!-- config api -->
        <dependency>
            <groupId>io.jans</groupId>
            <artifactId>jans-config-api-shared</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.jans</groupId>
            <artifactId>jans-config-api-server</artifactId>
            <scope>compile</scope>
        </dependency>
		<dependency>
			<groupId>io.jans</groupId>
			<artifactId>jans-auth-client</artifactId>
		</dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.2</version>
        </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>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>2.3.2</version>
        </dependency>

        <!-- Runtime, com.sun.xml.bind module -->
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.2</version>
        </dependency>
        
       	<!-- Swagger -->
		<dependency>
			<groupId>io.swagger.core.v3</groupId>
			<artifactId>swagger-core-jakarta</artifactId>
		</dependency>

        <!-- Mockito TestNG Support -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-testng</artifactId>
            <version>0.5.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>admin-ui-plugin</finalName>
        
       <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>
		
        <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>
                <version>3.5.0</version>
                <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>jans-admin-ui-plugin-swagger</outputFileName>
							<contextId>${project.artifactId}</contextId>
							<prettyPrint>true</prettyPrint>
							<resourcePackages>
								<package>io.jans.ca.plugin.adminui.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>