<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <!-- Keep in sync with jboss-parent version in kie-user-bom-parent/pom.xml -->
    <version>36</version>
  </parent>
  <groupId>org.kie</groupId>
  <artifactId>process-migration-service</artifactId>
  <name>Process Instance Migration Service</name>
  <version>7.68.0.Final</version>

  <properties>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.release>11</maven.compiler.release>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.skip.unit.tests>false</maven.skip.unit.tests>
    <maven.skip.it.tests>false</maven.skip.it.tests>
    <version.com.fasterxml.jackson.core.jackson-databind>2.10.5.1</version.com.fasterxml.jackson.core.jackson-databind>
    <version.frontend.plugin>1.12.0</version.frontend.plugin>
    <version.io.quarkus>2.2.3.Final</version.io.quarkus>
    <version.io.quarkiverse.file-vault>0.3.0</version.io.quarkiverse.file-vault>
    <version.org.github.tomakehurst.wiremock-jre8>2.27.2</version.org.github.tomakehurst.wiremock-jre8>
    <version.org.kie.server>${project.version}</version.org.kie.server>
    <version.org.mockito>3.7.7</version.org.mockito>
    <version.org.projectlombok.lombok>1.18.16</version.org.projectlombok.lombok>

    <!-- Quarkus database setup -->
    <maven.jdbc.db-kind>h2</maven.jdbc.db-kind>
    <maven.jdbc.url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</maven.jdbc.url>
    <maven.jdbc.username>sa</maven.jdbc.username>
    <maven.jdbc.password>sa</maven.jdbc.password>
    <maven.jdbc.schema>PUBLIC</maven.jdbc.schema>

    <!-- Cargo plugin configuration -->
    <container.port>8080</container.port>
    <version.org.wildfly>23.0.2.Final</version.org.wildfly>
    <cargo.container.id>valid-id-needs-to-be-specified-in-appropriate-container-profile</cargo.container.id>
    <org.kie.server.datasource.connection.url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</org.kie.server.datasource.connection.url>
    <org.kie.server.persistence.dialect>org.hibernate.dialect.H2Dialect</org.kie.server.persistence.dialect>
    <org.kie.server.datasource.driver.class>org.h2.jdbcx.JdbcDataSource</org.kie.server.datasource.driver.class>
    <org.kie.server.datasource.username>sa</org.kie.server.datasource.username>
    <org.kie.server.datasource.password>sa</org.kie.server.datasource.password>
    <kie.server.classifier>ee8</kie.server.classifier>

    <!-- KIE Server configuration -->
    <maven.kie.server.id>test-kie-server</maven.kie.server.id>
    <maven.kie.server.context>kie-server</maven.kie.server.context>
    <maven.kie.server.host>localhost</maven.kie.server.host>
    <maven.kie.server.http.port>${container.port}</maven.kie.server.http.port>
    <maven.kie.server.http.url>http://${maven.kie.server.host}:${maven.kie.server.http.port}/${maven.kie.server.context}/services/rest/server</maven.kie.server.http.url>
    <maven.kie.server.username>kieserver</maven.kie.server.username>
    <maven.kie.server.password>kieserver1!</maven.kie.server.password>

    <!-- PIM service configuration -->
    <maven.pim.server.host>localhost</maven.pim.server.host>
    <maven.pim.server.http.port>8081</maven.pim.server.http.port>
    <maven.pim.username>admin</maven.pim.username>
    <maven.pim.password>admin1!</maven.pim.password>
    <maven.pim.admin.role>admin</maven.pim.admin.role>
    <maven.pim.server.http.url>http://${maven.pim.server.host}:${maven.pim.server.http.port}</maven.pim.server.http.url>
    <maven.pim.server.http.health>${maven.pim.server.http.url}/q/health</maven.pim.server.http.health>

    <maven.pim.flyway.prefix.version>1.0.0__</maven.pim.flyway.prefix.version>
  </properties>

  <repositories>
    <repository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Public Repository Group</name>
      <url>https://repository.jboss.org/nexus/content/groups/public/</url>
      <layout>default</layout>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </snapshots>
    </repository>
  </repositories>

  <scm>
    <connection>scm:git:https://github.com:kiegroup/process-migration-service.git</connection>
    <developerConnection>scm:git:git@github.com:kiegroup/process-migration-service.git</developerConnection>
    <url>https://github.com/kiegroup/process-migration-service</url>
  </scm>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-bom</artifactId>
        <version>${version.io.quarkus}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${version.org.projectlombok.lombok}</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>com.github.tomakehurst</groupId>
        <artifactId>wiremock-jre8</artifactId>
        <version>${version.org.github.tomakehurst.wiremock-jre8}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-inline</artifactId>
        <version>${version.org.mockito}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.quarkiverse.file-vault</groupId>
        <artifactId>quarkus-file-vault</artifactId>
        <version>${version.io.quarkiverse.file-vault}</version>
      </dependency>
      <!-- droolsjbpm-integration dependencies - start -->
      <dependency>
        <groupId>org.kie.server</groupId>
        <artifactId>kie-server-client</artifactId>
        <version>${version.org.kie.server}</version>
      </dependency>
      <dependency>
        <groupId>org.kie.server</groupId>
        <artifactId>kie-server-controller-client</artifactId>
        <version>${version.org.kie.server}</version>
      </dependency>
      <dependency>
        <groupId>org.kie</groupId>
        <artifactId>kie-test-util</artifactId>
        <version>${version.org.kie.server}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${version.com.fasterxml.jackson.core.jackson-databind}</version>
      </dependency>
      <!--  droolsjbpm-integration dependencies- end -->
      <dependency>
        <groupId>org.kie.soup</groupId>
        <artifactId>kie-soup-maven-integration</artifactId>
        <version>${version.org.kie.server}</version>
        <exclusions>
          <exclusion>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- KIE Dependencies -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-client</artifactId>
    </dependency>

    <!-- Quarkus -->
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-health</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-config-yaml</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-hibernate-orm-panache</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-quartz</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-container-image-jib</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-flyway</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.file-vault</groupId>
      <artifactId>quarkus-file-vault</artifactId>
    </dependency>
    <!-- JDBC Extensions -->
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-h2</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-mariadb</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-postgresql</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-mysql</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-mssql</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-oracle</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-db2</artifactId>
    </dependency>
    <!-- Bundled identityProviders -->
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-elytron-security-properties-file</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-elytron-security-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-elytron-security-ldap</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-narayana-jta</artifactId>
    </dependency>
    <!-- External dependencies -->
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
    <!-- Test dependencies -->
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-test-util</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-junit5</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-junit5-mockito</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-inline</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-test-h2</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.tomakehurst</groupId>
      <artifactId>wiremock-jre8</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.soup</groupId>
      <artifactId>kie-soup-maven-integration</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server</artifactId>
      <version>${version.org.kie.server}</version>
      <classifier>${kie.server.classifier}</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
      <testResource>
        <directory>src/test/filtered-resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>*.yaml</include>
          <include>*.properties</include>
        </includes>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <forceJavacCompilerUse>true</forceJavacCompilerUse>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>${version.io.quarkus}</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
              <goal>generate-code</goal>
              <goal>generate-code-tests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skipTests>${maven.skip.unit.tests}</skipTests>
          <systemPropertyVariables>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
            <maven.home>${maven.home}</maven.home>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>reserve-network-port</id>
            <goals>
              <goal>reserve-network-port</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <portNames>
                <portName>container.port</portName>
                <portName>cargo.jboss.ajp.port</portName>
                <portName>cargo.jboss.https.port</portName>
                <portName>cargo.jboss.management-http.port</portName>
                <portName>cargo.jboss.management-https.port</portName>
              </portNames>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven3-plugin</artifactId>
        <configuration>
          <container>
            <containerId>${cargo.container.id}</containerId>
            <systemProperties>
              <org.kie.server.id>${maven.kie.server.id}</org.kie.server.id>
              <kie.server.base.http.url>${maven.kie.server.http.url}</kie.server.base.http.url>
              <!-- Persistence configuration -->
              <org.kie.server.persistence.ds>${org.kie.server.persistence.ds}</org.kie.server.persistence.ds>
              <org.kie.server.persistence.dialect>${org.kie.server.persistence.dialect}</org.kie.server.persistence.dialect>
              <!-- disable JMS support for executor to use same tests for all containers for jbpm executor -->
              <org.kie.executor.jms>false</org.kie.executor.jms>
              <org.kie.server.sync.deploy>true</org.kie.server.sync.deploy>
            </systemProperties>
            <dependencies>
              <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
              </dependency>
            </dependencies>
          </container>
          <deployer/>
          <deployables>
            <deployable>
              <groupId>org.kie.server</groupId>
              <artifactId>kie-server</artifactId>
              <!-- default, may be overridden in container specific profiles -->
              <classifier>${kie.server.classifier}</classifier>
              <type>war</type>
              <properties>
                <context>${maven.kie.server.context}</context>
              </properties>
              <pingURL>${maven.kie.server.http.url}</pingURL>
              <pingTimeout>60000</pingTimeout>
            </deployable>
          </deployables>
          <configuration>
            <properties>
              <cargo.servlet.port>${container.port}</cargo.servlet.port>
            </properties>
            <users>
              <user>
                <name>Administrator</name>
                <password>${maven.kie.server.password}</password>
                <roles>
                  <role>kie-server</role>
                  <role>guest</role>
                  <role>Administrators</role>
                </roles>
              </user>
              <user>
                <name>${maven.kie.server.username}</name>
                <password>${maven.kie.server.password}</password>
                <roles>
                  <role>kie-server</role>
                </roles>
              </user>
            </users>
          </configuration>
        </configuration>
        <executions>
          <execution>
            <id>start-container</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>stop-container</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.bazaarvoice.maven.plugins</groupId>
        <artifactId>process-exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>start-process-migration-service</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
            <configuration>
              <name>ProcessMigrationService</name>
              <healthcheckUrl>${maven.pim.server.http.health}</healthcheckUrl>
              <waitForInterrupt>false</waitForInterrupt>
              <waitAfterLaunch>300</waitAfterLaunch>
              <processLogFile>${project.build.directory}/pim.log</processLogFile>
              <arguments>
                <argument>java</argument>
                <argument>-Dkieservers[0].host=${maven.kie.server.http.url}</argument>
                <argument>-Dkieservers[0].username=${maven.kie.server.username}</argument>
                <argument>-Dkieservers[0].password=${maven.kie.server.password}</argument>
                <argument>-Dquarkus.http.port=${maven.pim.server.http.port}</argument>
                <argument>-jar</argument>
                <argument>${project.build.directory}/quarkus-app/quarkus-run.jar</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>stop-process-migration-service</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop-all</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <skipITs>${maven.skip.it.tests}</skipITs>
          <systemPropertyVariables>
            <kie.server.id>${maven.kie.server.id}</kie.server.id>
            <kie.server.http.url>${maven.kie.server.http.url}</kie.server.http.url>
            <kie.server.username>${maven.kie.server.username}</kie.server.username>
            <kie.server.password>${maven.kie.server.password}</kie.server.password>
            <pim.http.url>${maven.pim.server.http.url}</pim.http.url>
            <pim.username>${maven.pim.username}</pim.username>
            <pim.password>${maven.pim.password}</pim.password>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>${version.frontend.plugin}</version>
        <configuration>
          <workingDirectory>frontend</workingDirectory>
          <nodeVersion>v12.16.2</nodeVersion>
          <npmVersion>7.15.1</npmVersion>
          <yarnVersion>v1.22.4</yarnVersion>
        </configuration>
        <executions>
          <execution>
            <id>install node and npm</id>
            <phase>initialize</phase>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
          </execution>
          <execution>
            <id>lock-treatment-tool execution</id>
            <phase>initialize</phase>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>exec @kie/lock-treatment-tool --</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm install</id>
            <phase>compile</phase>
            <goals>
              <goal>npm</goal>
            </goals>
          </execution>
          <execution>
            <id>npm run build</id>
            <phase>compile</phase>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>run build</arguments>
            </configuration>
          </execution>
          <execution>
            <id>run tests</id>
            <phase>test</phase>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>test</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>process-classes</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF/resources</outputDirectory>
              <resources>
                <resource>
                  <directory>frontend/dist</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-css</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/${project.build.finalName}/css</outputDirectory>
              <overwrite>true</overwrite>
              <resources>
                <resource>
                  <directory>frontend/src/css/</directory>
                  <includes>
                    <include>**/*</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <configuration>
              <target>
                <concat destfile="${project.build.outputDirectory}/db/migration/h2/h2${maven.pim.flyway.prefix.version}pim-schema.sql">
                  <fileset file="${project.basedir}/ddl-scripts/h2/h2-quartz-schema.sql" />
                  <fileset file="${project.basedir}/ddl-scripts/h2/h2-pim-schema.sql" />
                </concat>
                <concat destfile="${project.build.outputDirectory}/db/migration/db2/db2${maven.pim.flyway.prefix.version}pim-schema.sql">
                  <fileset file="${project.basedir}/ddl-scripts/db2/db2-quartz-schema.sql" />
                  <fileset file="${project.basedir}/ddl-scripts/db2/db2-pim-schema.sql" />
                </concat>
                <concat destfile="${project.build.outputDirectory}/db/migration/mariadb/mariadb${maven.pim.flyway.prefix.version}pim-schema.sql">
                  <fileset file="${project.basedir}/ddl-scripts/mariadb/mariadb-quartz-schema.sql" />
                  <fileset file="${project.basedir}/ddl-scripts/mariadb/mariadb-pim-schema.sql" />
                </concat>
                <concat destfile="${project.build.outputDirectory}/db/migration/mssql/mssql${maven.pim.flyway.prefix.version}pim-schema.sql">
                  <fileset file="${project.basedir}/ddl-scripts/mssql/mssql-quartz-schema.sql" />
                  <fileset file="${project.basedir}/ddl-scripts/mssql/mssql-pim-schema.sql" />
                </concat>
                <concat destfile="${project.build.outputDirectory}/db/migration/mysql/mysql${maven.pim.flyway.prefix.version}pim-schema.sql">
                  <fileset file="${project.basedir}/ddl-scripts/mysql/mysql-quartz-schema.sql" />
                  <fileset file="${project.basedir}/ddl-scripts/mysql/mysql-pim-schema.sql" />
                </concat>
                <concat destfile="${project.build.outputDirectory}/db/migration/oracle/oracle${maven.pim.flyway.prefix.version}pim-schema.sql">
                  <fileset file="${project.basedir}/ddl-scripts/oracle/oracle-quartz-schema.sql" />
                  <fileset file="${project.basedir}/ddl-scripts/oracle/oracle-pim-schema.sql" />
                </concat>
                <concat destfile="${project.build.outputDirectory}/db/migration/postgresql/postgresql${maven.pim.flyway.prefix.version}pim-schema.sql">
                  <fileset file="${project.basedir}/ddl-scripts/postgresql/postgresql-quartz-schema.sql" />
                  <fileset file="${project.basedir}/ddl-scripts/postgresql/postgresql-pim-schema.sql" />
                </concat>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${version.assembly.plugin}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/process-migration-distribution.xml</descriptor>
          </descriptors>
          <appendAssemblyId>false</appendAssemblyId>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>podman</id>
      <activation>
        <file>
          <exists>/run/user/1000/podman/podman.sock</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <environmentVariables>
                <DOCKER_HOST>unix:///run/user/1000/podman/podman.sock</DOCKER_HOST>
                <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
                <api.version>v2</api.version>
              </environmentVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </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>
    <profile>
      <id>wildfly</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>wildfly</value>
        </property>
      </activation>
      <properties>
        <cargo.container.id>wildfly23x</cargo.container.id>
        <org.kie.server.persistence.ds>java:/jdbc/jbpm</org.kie.server.persistence.ds>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven3-plugin</artifactId>
            <configuration>
              <container>
                <artifactInstaller>
                  <groupId>org.wildfly</groupId>
                  <artifactId>wildfly-dist</artifactId>
                  <version>${version.org.wildfly}</version>
                </artifactInstaller>
              </container>
              <configuration>
                <properties>
                  <cargo.jboss.management-http.port>19991</cargo.jboss.management-http.port>
                  <cargo.jboss.configuration>standalone-full</cargo.jboss.configuration>
                  <cargo.jvmargs>-Xmx1024m</cargo.jvmargs>
                  <cargo.jboss.ajp.port>${cargo.jboss.ajp.port}</cargo.jboss.ajp.port>
                  <cargo.jboss.https.port>${cargo.jboss.https.port}</cargo.jboss.https.port>
                  <cargo.jboss.management-http.port>${cargo.jboss.management-http.port}</cargo.jboss.management-http.port>
                  <cargo.jboss.management-https.port>${cargo.jboss.management-https.port}</cargo.jboss.management-https.port>
                </properties>
                <datasources>
                  <datasource>
                    <jndiName>${org.kie.server.persistence.ds}</jndiName>
                    <driverClass>${org.kie.server.datasource.driver.class}</driverClass>
                    <url>${org.kie.server.datasource.connection.url}</url>
                    <username>${org.kie.server.datasource.username}</username>
                    <password>${org.kie.server.datasource.password}</password>
                    <transactionSupport>XA_TRANSACTION</transactionSupport>
                  </datasource>
                </datasources>
              </configuration>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- This profile basically disables any cargo related execution. It can be used when the tests should run on
     a container that has already been started and it is not managed by cargo. It can also be used when doing
     a "no-test" build, as the container should not be used in that case. -->
    <profile>
      <id>custom-container</id>
      <activation>
        <!-- The tests are not executed unless specific container profile is used. Disable cargo by default. -->
        <activeByDefault>true</activeByDefault>
        <property>
          <name>custom-container</name>
        </property>
      </activation>
      <properties>
        <cargo.maven.skip>true</cargo.maven.skip>
        <exec.skip>true</exec.skip>
      </properties>
    </profile>
    <profile>
      <!-- Integration tests are skipped by default. They are activated when specific container profile is used. -->
      <id>skipITs-by-default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <maven.skip.it.tests>true</maven.skip.it.tests>
      </properties>
    </profile>
  </profiles>
</project>
