<?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>
    <groupId>com.jagrosh</groupId>
    <artifactId>Vortex</artifactId>
    <version>2.4</version>
    <packaging>jar</packaging>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <kotlin.version>2.3.21</kotlin.version>
    </properties>
    
    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
        <repository>
          <id>m2-chew-releases</id>
          <name>Maven Chewtral</name>
          <url>https://m2.chew.pro/releases</url>
        </repository>
        <repository>
            <id>csarcane</id>
            <name>CS Arcane</name>
            <url>https://dl.cloudsmith.io/public/arcane/archive/maven</url>
        </repository>
        <repository>
            <id>jcenter</id>
            <name>jcenter-bintray</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
    </repositories>
    
    <dependencies>
	<dependency>
	    <groupId>com.github.discord-jda</groupId>
	    <artifactId>JDA</artifactId>
	    <version>v6.4.1</version>
	</dependency>
	<dependency>
	    <groupId>pw.chew</groupId>
	    <artifactId>jda-chewtils</artifactId>
	    <version>2.2.1</version>
      <scope>compile</scope>
      <type>pom</type>
	</dependency>
	<dependency>
	    <groupId>com.github.jagrosh</groupId>
	    <artifactId>easysql</artifactId>
	    <version>d72d4394a5</version>
	</dependency>
        <dependency>
            <groupId>club.minnced</groupId>
            <artifactId>discord-webhooks</artifactId>
            <version>0.1.8</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>3.13.0</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.13</version>
        </dependency>
        <dependency>
            <groupId>com.typesafe</groupId>
            <artifactId>config</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
      <plugins>
          <plugin>
              <groupId>org.jetbrains.kotlin</groupId>
              <artifactId>kotlin-maven-plugin</artifactId>
              <version>${kotlin.version}</version>
              <extensions>true</extensions> <!-- Enable the extension -->
              <executions>
                  <execution>
                      <id>kotlin-compile</id>
                      <phase>compile</phase>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                      <configuration>
                          <sourceDirs>
                              <sourceDir>src/main/kotlin</sourceDir>
                              <!-- Ensure Kotlin code can reference Java code -->
                              <sourceDir>src/main/java</sourceDir>
                          </sourceDirs>
                      </configuration>
                  </execution>
                  <execution>
                      <id>kotlin-test-compile</id>
                      <phase>test-compile</phase>
                      <goals>
                          <goal>test-compile</goal>
                      </goals>
                      <configuration>
                          <sourceDirs>
                              <sourceDir>src/test/kotlin</sourceDir>
                              <sourceDir>src/test/java</sourceDir>
                          </sourceDirs>
                      </configuration>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.15.0</version>
              <executions>
                  <!-- Disable default executions -->
                  <execution>
                      <id>default-compile</id>
                      <phase>none</phase>
                  </execution>
                  <execution>
                      <id>default-testCompile</id>
                      <phase>none</phase>
                  </execution>

                  <!-- Define custom executions -->
                  <execution>
                      <id>java-compile</id>
                      <phase>compile</phase>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                  </execution>
                  <execution>
                      <id>java-test-compile</id>
                      <phase>test-compile</phase>
                      <goals>
                          <goal>testCompile</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <configuration>
            <archive>
              <manifest>
                <mainClass>com.jagrosh.vortex.Vortex</mainClass>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
            </archive>
            <descriptorRefs>
              <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
          </configuration>
          <executions>
            <execution>
              <id>make-assembly</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
</project>
