<?xml version="1.0"?>
<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.apicurio</groupId>
        <artifactId>apicurio-registry-storage</artifactId>
        <version>2.6.11.redhat-00001</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>apicurio-registry-storage-sql</artifactId>
    <packaging>jar</packaging>
    <name>apicurio-registry-storage-sql</name>
    <properties>
    <quarkus.version>3.15.3.redhat-00002</quarkus.version>
  </properties>


    <dependencies>
        <!-- Project Deps -->
        <dependency>
            <groupId>io.apicurio</groupId>
            <artifactId>apicurio-registry-app</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-jdbc-h2</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jdbc-postgresql</artifactId>
        </dependency>

        <!-- Test Only -->
        <dependency>
            <groupId>io.apicurio</groupId>
            <artifactId>apicurio-registry-app</artifactId>
            <type>test-jar</type>
            <exclusions>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-jdbc-h2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.apicurio</groupId>
                    <artifactId>apicurio-registry-schema-util-provider</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.zonky.test</groupId>
            <artifactId>embedded-postgres</artifactId>
            <version>${embedded-postgres.version}</version><!--$NO-MVN-MAN-VER$-->
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-static-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>apicurio-registry-app</artifactId>
                                    <version>${project.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <includes>**/web.xml,**/application.properties</includes>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-test-dependencies</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeGroupIds>io.apicurio</includeGroupIds>
                            <includeTypes>test-jar</includeTypes>
                            <includeScope>test</includeScope>
                            <outputDirectory>
                                ${project.build.directory}/test-classes
                            </outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.apicurio</groupId>
                <artifactId>apicurio-common-app-components-maven-plugin</artifactId>
                <version>${apicurio-common-app-components.version}</version>
                <executions>
                    <execution>
                        <id>merge-properties</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <output>${project.build.outputDirectory}/application.properties</output>
                            <inputs>
                                <param>${project.build.outputDirectory}/application.properties</param>
                                <param>${project.build.outputDirectory}/overlay.properties</param>
                            </inputs>
                            <deleteInputs>true</deleteInputs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>merge-test-properties</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <output>${project.build.testOutputDirectory}/application.properties</output>
                            <inputs>
                                <param>${project.build.outputDirectory}/application.properties</param>
                                <param>${project.build.testOutputDirectory}/test-overlay.properties</param>
                            </inputs>
                            <deleteInputs>false</deleteInputs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.redhat.quarkus.platform</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
                <version>3.15.3.redhat-00002</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <groups>${groups}</groups>
                    <systemProperties>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <attach>true</attach>
                            <descriptors>
                                <descriptor>src/main/assembly/assembly.xml</descriptor>
                            </descriptors>
                            <archiverConfig>
                                <defaultDirectoryMode>0755</defaultDirectoryMode>
                            </archiverConfig>
                            <tarLongFileMode>${tar.long.file.mode}</tarLongFileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>false</skip>
        </configuration>
      </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>no-docker</id>
            <properties>
                <groups>!docker</groups>
            </properties>
        </profile>
        <profile>
            <id>no-slow-tests</id>
            <properties>
                <groups>!slow</groups>
            </properties>
        </profile>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <native.image.path>
                                            ${project.build.directory}/${project.build.finalName}-runner
                                        </native.image.path>
                                        <java.util.logging.manager>org.jboss.logmanager.LogManager
                                        </java.util.logging.manager>
                                        <maven.home>${maven.home}</maven.home>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <quarkus.package.type>native</quarkus.package.type>
            </properties>
        </profile>
    </profiles>
</project>
