<?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>parent</artifactId>
      <groupId>org.taxilang</groupId>
      <version>1.71.0</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>

   <artifactId>taxi-cli</artifactId>
   <name>${artifactId}</name>
   <properties>
      <pf4j.version>3.10.0</pf4j.version>
      <jreleaser.config.file>jreleaser.yml</jreleaser.config.file>
      <jreleaser.git.root.search>true</jreleaser.git.root.search>
      <app.main.class>lang.taxi.cli.TaxiCli</app.main.class>
      <app.distribution.directory>${project.build.directory}/distributions/app</app.distribution.directory>
      <jline.version>3.29.0</jline.version>
   </properties>
   <dependencies>
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>package-manager</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>io.kotest</groupId>
         <artifactId>kotest-assertions-core-jvm</artifactId>
         <version>${kotest.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>taxi-to-openapi-plugin</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>compiler</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>compiler</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>taxi-generator-api</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-core</artifactId>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-annotations</artifactId>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.module</groupId>
         <artifactId>jackson-module-kotlin</artifactId>
      </dependency>
      <dependency>
         <groupId>com.google.guava</groupId>
         <artifactId>guava</artifactId>
      </dependency>
      <dependency>
         <groupId>commons-io</groupId>
         <artifactId>commons-io</artifactId>
      </dependency>
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>taxi-plugin-api</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.pf4j</groupId>
         <artifactId>pf4j</artifactId>
         <version>${pf4j.version}</version>
      </dependency>

      <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter</artifactId>
      </dependency>
      <dependency>
         <groupId>org.jline</groupId>
         <artifactId>jline</artifactId>
         <version>${jline.version}</version>
      </dependency>

      <dependency>
         <!-- because I want to use RestTemplate.  Probably overkill -->
         <groupId>org.springframework</groupId>
         <artifactId>spring-web</artifactId>
      </dependency>
      <dependency>
         <groupId>org.jcommander</groupId>
         <artifactId>jcommander</artifactId>
         <version>2.0</version>
      </dependency>
      <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-exec</artifactId>
         <version>1.3</version>
      </dependency>
      <dependency>
         <groupId>com.typesafe</groupId>
         <artifactId>config</artifactId>
      </dependency>
      <dependency>
         <groupId>io.github.config4k</groupId>
         <artifactId>config4k</artifactId>
      </dependency>
      <dependency>
         <groupId>net.lingala.zip4j</groupId>
         <artifactId>zip4j</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-model</artifactId>
         <version>3.9.0</version>
      </dependency>

      <!-- TODO : Move this out so that Kotlin plugin isn't bundled -->
      <dependency>
         <groupId>org.taxilang</groupId>
         <artifactId>taxi2kotlin</artifactId>
         <version>${project.version}</version>
      </dependency>
   </dependencies>

   <build>
      <finalName>taxi-cli</finalName>
      <plugins>
         <plugin>
            <groupId>org.graalvm.buildtools</groupId>
            <artifactId>native-maven-plugin</artifactId>
         </plugin>
         <plugin>
            <groupId>io.github.git-commit-id</groupId>
            <artifactId>git-commit-id-maven-plugin</artifactId>
            <version>5.0.0</version>
            <executions>
               <execution>
                  <id>get-the-git-infos</id>
                  <goals>
                     <goal>revision</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <generateGitPropertiesFile>true</generateGitPropertiesFile>
               <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
               </generateGitPropertiesFilename>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-plugin</artifactId>
            <version>${kotlin.version}</version>
            <executions>
               <execution>
                  <id>compile</id>
                  <phase>process-sources</phase>
                  <goals>
                     <goal>compile</goal>
                  </goals>
               </execution>
               <execution>
                  <id>test-compile</id>
                  <phase>process-test-resources</phase>
                  <goals>
                     <goal>test-compile</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <compilerPlugins>
                  <!-- Or "spring" for the Spring support -->
                  <plugin>spring</plugin>
                  <plugin>jpa</plugin>
                  <plugin>no-arg</plugin>
               </compilerPlugins>
            </configuration>
            <dependencies>
               <dependency>
                  <groupId>org.jetbrains.kotlin</groupId>
                  <artifactId>kotlin-maven-allopen</artifactId>
                  <version>${kotlin.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.jetbrains.kotlin</groupId>
                  <artifactId>kotlin-maven-noarg</artifactId>
                  <version>${kotlin.version}</version>
               </dependency>
            </dependencies>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.11.0</version>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>appassembler-maven-plugin</artifactId>
            <version>2.1.0</version>
            <executions>
               <execution>
                  <id>assemble-script</id>
                  <phase>package</phase>
                  <goals>
                     <goal>assemble</goal>
                  </goals>
                  <configuration>
                     <showConsoleWindow>true</showConsoleWindow>
                     <programs>
                        <program>
                           <mainClass>${app.main.class}</mainClass>
                           <id>taxi</id>
                        </program>
                     </programs>
                     <repositoryLayout>flat</repositoryLayout>
                     <repositoryName>lib</repositoryName>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.5.0</version>
            <configuration>
               <descriptors>
                  <descriptor>src/main/assembly/assembly.xml</descriptor>
               </descriptors>
               <appendAssemblyId>false</appendAssemblyId>
               <finalName>taxi</finalName>
               <attach>true</attach>
            </configuration>
            <executions>
               <execution>
                  <id>make-assembly</id> <!-- this is used for inheritance merges -->
                  <phase>package</phase> <!-- bind to the packaging phase -->
                  <goals>
                     <goal>single</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <executions>
               <execution>
                  <goals>
                     <goal>build-info</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
   <profiles>
      <profile>
         <id>sdkman</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>io.sdkman</groupId>
                  <artifactId>sdkman-maven-plugin</artifactId>
                  <version>2.0.0</version>
                  <executions>
                     <execution>
                        <goals>
                           <goal>major-release</goal>
                        </goals>
                        <phase>deploy</phase>
                        <configuration>
                           <apiHost>vendors.sdkman.io</apiHost>
                           <candidate>taxi</candidate>
                           <version>${project.version}</version>
                           <url>
                              https://repo.orbitalhq.com/release/org/taxilang/taxi-cli/${project.version}/taxi-cli-${project.version}.zip
                           </url>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>

</project>
