<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ QQQ - Low-code Application Framework for Engineers.
  ~ Copyright (C) 2021-2022.  Kingsrook, LLC
  ~ 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
  ~ contact@kingsrook.com
  ~ https://github.com/Kingsrook/
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>

   <artifactId>qqq-middleware-javalin</artifactId>
   <name>QQQ Middleware - Javalin</name>
   <description>Javalin middleware for the QQQ framework.</description>

   <parent>
      <groupId>com.kingsrook.qqq</groupId>
      <artifactId>qqq-parent-project</artifactId>
      <version>4.1.0-RC.2</version>
   </parent>

   <properties>
      <kotlin.version>2.3.0</kotlin.version>
      <javalin.openapi.version>7.2.3</javalin.openapi.version>
   </properties>

   <dependencies>
      <!-- other qqq modules deps -->
      <dependency>
         <groupId>com.kingsrook.qqq</groupId>
         <artifactId>qqq-backend-core</artifactId>
         <version>4.1.0-RC.2</version>
      </dependency>
      <dependency>
         <groupId>com.kingsrook.qqq</groupId>
         <artifactId>qqq-openapi</artifactId>
         <version>4.1.0-RC.2</version>
      </dependency>

      <dependency>
         <groupId>com.kingsrook.qqq</groupId>
         <artifactId>qqq-backend-module-rdbms</artifactId>
         <version>4.1.0-RC.2</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.kingsrook.qqq</groupId>
         <artifactId>qqq-language-support-javascript</artifactId>
         <version>4.1.0-RC.2</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.kingsrook.qqq</groupId>
         <artifactId>qqq-frontend-material-dashboard</artifactId>
         <version>0.36.1</version>
         <scope>test</scope>
         <optional>true</optional>
      </dependency>

      <!-- 3rd party deps specifically for this module -->
      <dependency>
         <groupId>info.picocli</groupId>
         <artifactId>picocli</artifactId>
         <version>4.7.7</version>
      </dependency>
      <dependency>
         <groupId>io.javalin</groupId>
         <artifactId>javalin</artifactId>
         <version>${javalin.version}</version>
      </dependency>
      <dependency>
         <groupId>org.jetbrains.kotlin</groupId>
         <artifactId>kotlin-stdlib</artifactId>
         <version>${kotlin.version}</version>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-simple</artifactId>
         <version>2.0.18</version>
      </dependency>
      <dependency>
         <groupId>com.konghq</groupId>
         <artifactId>unirest-java</artifactId>
         <version>3.14.5</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <version>2.4.240</version>
         <scope>test</scope>
      </dependency>

      <!-- Common deps for all qqq modules -->
      <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-api</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-core</artifactId>
      </dependency>
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-engine</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>net.bytebuddy</groupId>
         <artifactId>byte-buddy</artifactId>
         <version>1.18.4</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
         <version>5.21.0</version>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <build>
      <sourceDirectory>src/main/java</sourceDirectory>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.5.4</version>
            <configuration>
               <additionalClasspathElements>
                  <additionalClasspathElement>
                     ${project.basedir}/src/test/resources/static-site.jar
                  </additionalClasspathElement>
               </additionalClasspathElements>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.14.1</version>
            <configuration>
               <annotationProcessorPaths>
                  <annotationProcessorPath>
                     <groupId>io.javalin.community.openapi</groupId>
                     <artifactId>openapi-annotation-processor</artifactId>
                     <version>${javalin.openapi.version}</version>
                  </annotationProcessorPath>
               </annotationProcessorPaths>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <configuration>
               <excludes>
                  <exclude>com/kingsrook/qqq/middleware/javalin/executors/io/*.class</exclude>
                  <exclude>com/kingsrook/qqq/middleware/javalin/tools/**/*.class</exclude>
                  <exclude>com/kingsrook/qqq/middleware/javalin/specs/**/*.class</exclude>
                  <exclude>com/kingsrook/qqq/middleware/javalin/examples/**/*.class</exclude>
               </excludes>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>appassembler-maven-plugin</artifactId>
            <version>1.10</version>
            <configuration>
               <programs>
                  <program>
                     <mainClass>com.kingsrook.qqq.middleware.javalin.tools.ValidateAPIVersions</mainClass>
                     <id>ValidateApiVersions</id>
                  </program>
               </programs>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.5.0</version>
            <executions>
               <execution>
                  <goals>
                     <goal>test-jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>2.4.3</version>
            <configuration>
               <createDependencyReducedPom>false</createDependencyReducedPom>
               <filters>
                  <filter>
                     <artifact>*:*</artifact>
                     <excludes>
                        <exclude>META-INF/*</exclude>
                     </excludes>
                  </filter>
               </filters>
            </configuration>
            <executions>
               <execution>
                  <phase>${plugin.shade.phase}</phase>
                  <goals>
                     <goal>shade</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>

   <repositories>
      <repository>
         <id>sonatype-snapshots</id>
         <url>https://central.sonatype.com/repository/maven-snapshots/</url>
      </repository>
   </repositories>

</project>
