<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.hccake</groupId>
    <artifactId>ballcat-codegen</artifactId>
    <version>1.4.1</version>
  </parent>
  <groupId>com.hccake</groupId>
  <artifactId>ballcat-codegen-backend</artifactId>
  <version>1.4.1</version>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <properties>
    <flyway.version>7.15.0</flyway.version>
    <jasypt.version>3.0.5</jasypt.version>
    <freemarker.version>2.3.31</freemarker.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <dynamic-datasource.version>3.6.1</dynamic-datasource.version>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <ojdbc8.version>21.5.0.0</ojdbc8.version>
    <velocity.version>1.7</velocity.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.hccake</groupId>
      <artifactId>ballcat-spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
      <groupId>com.hccake</groupId>
      <artifactId>ballcat-extend-mybatis-plus</artifactId>
    </dependency>
    <dependency>
      <groupId>com.baomidou</groupId>
      <artifactId>mybatis-plus-boot-starter</artifactId>
    </dependency>
    <dependency>
      <groupId>com.github.ulisesbocchio</groupId>
      <artifactId>jasypt-spring-boot-starter</artifactId>
      <version>${jasypt.version}</version>
    </dependency>
    <dependency>
      <groupId>com.hccake</groupId>
      <artifactId>ballcat-extend-openapi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-ui</artifactId>
    </dependency>
    <dependency>
      <groupId>com.baomidou</groupId>
      <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
      <version>${dynamic-datasource.version}</version>
    </dependency>
    <dependency>
      <groupId>com.mysql</groupId>
      <artifactId>mysql-connector-j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>mssql-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>com.oracle.database.jdbc</groupId>
      <artifactId>ojdbc8</artifactId>
      <version>${ojdbc8.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.velocity</groupId>
      <artifactId>velocity</artifactId>
      <version>${velocity.version}</version>
    </dependency>
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>${freemarker.version}</version>
    </dependency>
    <dependency>
      <groupId>org.flywaydb</groupId>
      <artifactId>flyway-core</artifactId>
      <version>${flyway.version}</version>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>static/report/**</exclude>
          <exclude>**/*.woff</exclude>
          <exclude>**/*.woff2</exclude>
          <exclude>**/*.ttf</exclude>
          <exclude>**/*.ico</exclude>
        </excludes>
      </resource>
      <resource>
        <filtering>false</filtering>
        <directory>src/main/resources</directory>
        <includes>
          <include>static/report/**</include>
          <include>**/*.woff</include>
          <include>**/*.woff2</include>
          <include>**/*.ttf</include>
          <include>**/*.ico</include>
        </includes>
      </resource>
      <resource>
        <filtering>false</filtering>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.xml</include>
        </includes>
      </resource>
    </resources>
    <finalName>ballcat-codegen</finalName>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <phase>clean</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <delete includeemptydirs="true" dir="src/main/resources/public" />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>copy Vue.js frontend content</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>src/main/resources/public</outputDirectory>
              <overwrite>true</overwrite>
              <resources>
                <resource>
                  <directory>${project.parent.basedir}/ballcat-codegen-frontend/target/dist</directory>
                  <includes>
                    <include>static/</include>
                    <include>index.html</include>
                    <include>favicon.ico</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>docker</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.spotify</groupId>
            <artifactId>dockerfile-maven-plugin</artifactId>
            <version>1.4.13</version>
            <executions>
              <execution>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <repository>ballcat-codegen</repository>
              <tag>latest</tag>
              <buildArgs>
                <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
              </buildArgs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
