<?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>kie-wb-common-cli</artifactId>
    <groupId>org.kie.workbench</groupId>
    <version>7.74.1.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>kie-wb-common-cli-migration-tool</artifactId>
  <name>KIE Workbench Common CLI Migration Tool Distribution</name>

  <properties>
    <mainClass>org.kie.workbench.common.migration.Main</mainClass>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.kie.workbench</groupId>
        <artifactId>kie-wb-common-cli-pom-migration</artifactId>
        <version>${version.org.kie}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.kie.workbench</groupId>
      <artifactId>kie-wb-common-cli-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench</groupId>
      <artifactId>kie-wb-common-cli-project-migration</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench</groupId>
      <artifactId>kie-wb-common-cli-forms-migration</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench</groupId>
      <artifactId>kie-wb-common-cli-system-configuration-migration</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench</groupId>
      <artifactId>kie-wb-common-cli-system-to-space-configuration-migration</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench</groupId>
      <artifactId>kie-wb-common-cli-pom-migration</artifactId>
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-ssh-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-ssh-backend</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench.forms</groupId>
      <artifactId>kie-wb-common-forms-fields</artifactId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <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.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <goals>
          <goal>java</goal>
        </goals>
        <configuration>
          <mainClass>${mainClass}</mainClass>
          <!-- Can override these args with `mvn exec:java -Dexec.args="$YOUR_ARGS_HERE"` -->
          <arguments>
            <argument>-t</argument>
            <argument>./.niogit</argument>
            <argument>-b</argument>
          </arguments>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/assembly/descriptor.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>tool-zip</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>unzip-niogit</id>
            <phase>process-test-resources</phase>
            <configuration>
              <target>
                <unzip src="${basedir}/src/test/resources/org.kie.workbench.common.migration/test_64x_niogit.zip" dest="${project.build.directory}" />
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
