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

   <artifactId>jwt-spring-boot-sample-app</artifactId>
   <version>0.0.1</version>
   <packaging>jar</packaging>

   <parent>
      <groupId>de.coderspack</groupId>
      <artifactId>spring-boot-starter-jwt</artifactId>
      <version>0.0.1</version>
   </parent>

   <properties>
      <dockerfile-maven-plugin.version>1.4.12</dockerfile-maven-plugin.version>
   </properties>

   <dependencies>
      <dependency>
         <groupId>de.coderspack</groupId>
         <artifactId>jwt-spring-boot-starter</artifactId>
         <version>${project.version}</version>
      </dependency>

      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-data-jpa</artifactId>
         <version>${spring-boot.version}</version>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-data-rest</artifactId>
         <version>${spring-boot.version}</version>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-security</artifactId>
      </dependency>

      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-devtools</artifactId>
         <version>${spring-boot.version}</version>
      </dependency>

      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <version>1.4.199</version>
         <scope>runtime</scope>
      </dependency>

      <!-- testing libraries -->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
      </dependency>
      <dependency>
         <groupId>org.springframework.security</groupId>
         <artifactId>spring-security-test</artifactId>
         <version>5.2.0.RELEASE</version>
      </dependency>
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter</artifactId>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
         </plugin>
         <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${spring-boot.version}</version>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>build-docker</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>com.spotify</groupId>
                  <artifactId>dockerfile-maven-plugin</artifactId>
                  <version>${dockerfile-maven-plugin.version}</version>
                  <executions>
                     <execution>
                        <id>default</id>
                        <goals>
                           <goal>build</goal>
                           <goal>push</goal>
                        </goals>
                        <!-- I don't have deployment -->
                        <phase>pre-integration-test</phase>
                     </execution>
                  </executions>
                  <configuration>
                     <dockerfile>${project.basedir}/src/main/docker/Dockerfile</dockerfile>
                     <repository>hubae/jwt-spring-security-demo</repository>
                     <tag>${project.version}</tag>
                     <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
                     <buildArgs>
                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                     </buildArgs>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>

</project>
