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

    <parent>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-secret-registry-parent</artifactId>
        <version>8.1.2</version>
    </parent>

    <artifactId>kafka-secret-registry-package</artifactId>
    <packaging>pom</packaging>
    <name>kafka-secret-registry-package</name>

    <licenses>
        <license>
            <name>Confluent License Agreement</name>
            <url>https://www.confluent.io/legal/confluent-license-agreement/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <!-- Dependencies are required only to ensure this module is built last. -->
    <dependencies>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>logredactor</artifactId>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-secret-registry-client</artifactId>
            <version>${io.confluent.secret-registry.version}</version>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-secret-registry</artifactId>
            <version>${io.confluent.secret-registry.version}</version>
        </dependency>
        <!-- kafka -> zookeeper -> jline ends up including junit 3.8.1 here. Explicitly list the
             dependency and scope it to test to avoid pulling it in -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/development.xml</descriptor>
                        <descriptor>src/assembly/package.xml</descriptor>
                    </descriptors>
                    <archive>
                        <manifest>
                            <mainClass>io.confluent.kafka.secretregistry.rest.SecretRegistryMain</mainClass>
                        </manifest>
                    </archive>
                    <attach>false</attach>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>standalone</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/standalone.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
