<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>
    <groupId>cn.dustlight.flow</groupId>
    <artifactId>flow-parent</artifactId>
    <version>0.1.7-alpha</version>
    <name>flow-parent</name>
    <description>流程服务</description>

    <properties>
        <java.version>11</java.version>

        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <repackage.classifier/>

        <spring-boot.version>2.5.2</spring-boot.version>
        <spring-native.version>0.10.1</spring-native.version>
        <spring-cloud-kubernetes.version>2.0.3</spring-cloud-kubernetes.version>
        <springdoc.version>1.5.9</springdoc.version>

        <zeebe.version>1.2.0</zeebe.version>

        <auth.version>1.1.1-alpha-4</auth.version>
        <datacenter.version>0.0.6-alpha-2</datacenter.version>
    </properties>

    <modules>
        <module>flow-core</module>
        <module>flow-zeebe</module>
        <module>flow-datacenter</module>
        <module>flow-trigger-store-elasticsearch</module>
        <module>flow-service</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-kubernetes-dependencies</artifactId>
                <version>${spring-cloud-kubernetes.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>cn.dustlight.flow</groupId>
                <artifactId>flow-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.dustlight.flow</groupId>
                <artifactId>flow-zeebe</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.dustlight.flow</groupId>
                <artifactId>flow-datacenter</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.dustlight.flow</groupId>
                <artifactId>flow-trigger-store-elasticsearch</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.dustlight.flow</groupId>
                <artifactId>flow-service</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>cn.dustlight.auth</groupId>
                <artifactId>auth-common</artifactId>
                <version>${auth.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>cn.dustlight.datacenter</groupId>
                <artifactId>datacenter-parent</artifactId>
                <version>${datacenter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-webflux-ui</artifactId>
                <version>${springdoc.version}</version>
            </dependency>


            <dependency>
                <groupId>io.camunda</groupId>
                <artifactId>zeebe-client-java</artifactId>
                <version>${zeebe.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot.version}</version>
                    <configuration>
                        <excludes>
                            <exclude>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                            </exclude>
                        </excludes>
                        <classifier>${repackage.classifier}</classifier>
                        <image>
                            <builder>paketobuildpacks/builder:tiny</builder>
                            <env>
                                <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
                            </env>
                        </image>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
<!--                        <execution>-->
<!--                            <id>pre-integration-test</id>-->
<!--                            <goals>-->
<!--                                <goal>start</goal>-->
<!--                            </goals>-->
<!--                        </execution>-->
<!--                        <execution>-->
<!--                            <id>post-integration-test</id>-->
<!--                            <goals>-->
<!--                                <goal>stop</goal>-->
<!--                            </goals>-->
<!--                        </execution>-->
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.springframework.experimental</groupId>
                    <artifactId>spring-aot-maven-plugin</artifactId>
                    <version>${spring-native.version}</version>
                    <executions>
                        <execution>
                            <id>test-generate</id>
                            <goals>
                                <goal>test-generate</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>generate</id>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Compiler -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>
                <!-- Source -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Javadoc -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                    <configuration>
                        <additionalparam>-Xdoclint:none</additionalparam>
                        <charset>${project.build.sourceEncoding}</charset>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <docencoding>${project.build.sourceEncoding}</docencoding>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- GPG -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <repositories>
        <repository>
            <id>spring-releases</id>
            <name>Spring Releases</name>
            <url>https://repo.spring.io/release</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-releases</id>
            <name>Spring Releases</name>
            <url>https://repo.spring.io/release</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>native</id>
            <properties>
                <repackage.classifier>exec</repackage.classifier>
                <native-buildtools.version>0.9.1</native-buildtools.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.graalvm.buildtools</groupId>
                    <artifactId>junit-platform-native</artifactId>
                    <version>${native-buildtools.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <version>${native-buildtools.version}</version>
                        <executions>
                            <execution>
                                <id>test-native</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>build-native</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>build</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <name>OSS Snapshots Repository</name>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <name>OSS Staging Repository</name>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <url>https://github.com/dustlight-cn/flow</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo,manual</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Hansin1997</name>
            <email>hansin@dustlight.cn</email>
            <url>https://github.com/Hansin1997</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/dustlight-cn/flow.git</connection>
        <developerConnection>scm:git:https://github.com/dustlight-cn/flow.git</developerConnection>
        <url>https://github.com/dustlight-cn/flow</url>
    </scm>

</project>
