<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2021. the original author or authors.
  ~
  ~ 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
  ~
  ~     http://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:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.0</version>
        <relativePath/>
    </parent>

    <groupId>group.idealworld.dew</groupId>
    <artifactId>parent-starter</artifactId>
    <name>1.0.0 Dew Parent Starter</name>
    <description>Dew 父工程</description>
    <packaging>pom</packaging>
    <version>3.0.0-Beta3</version>

    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
        <maven.compiler.encoding>${project.build.sourceEncoding}</maven.compiler.encoding>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.compiler.compilerVersion>${java.version}</maven.compiler.compilerVersion>
        <maven.install.skip>false</maven.install.skip>
        <maven.deploy.skip>false</maven.deploy.skip>
        <checkstyle.skip>false</checkstyle.skip>
        <checkstyle.config.path>../../checkstyle/checkstyle.xml</checkstyle.config.path>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
        <sonar.host.url></sonar.host.url>

        <main.class></main.class>
        <finalName>${project.artifactId}</finalName>
        <dew.version>3.0.0-Beta3</dew.version>

        <!--  核心依赖 -->
        <dew-common.version>3.0.0-beta4</dew-common.version>
        <simple-java-mail.version>6.6.1</simple-java-mail.version>
        <jakarta.validation.version>2.0.2</jakarta.validation.version>
        <springdoc.version>1.6.2</springdoc.version>
        <querydsl.version>5.0.0</querydsl.version>
        <!-- hbase-starter依赖 -->
        <hbase.version>2.4.8</hbase.version>
        <!-- test-starter依赖 -->
        <testcontainers.version>1.16.2</testcontainers.version>
        <!-- cluster-hazelcast依赖 -->
        <hazelcast.version>3.12.12</hazelcast.version>
        <!-- cluster-mqtt依赖 -->
        <mqtt.version>1.2.5</mqtt.version>
        <!-- DevOps -->
        <k8s-client-java.version>14.0.0</k8s-client-java.version>
        <docker-java.version>3.2.12</docker-java.version>
        <maven-plugin.version>3.6.0</maven-plugin.version>
        <mojo-executor.version>2.3.0</mojo-executor.version>
        <maven-resolver-api.version>1.3.3</maven-resolver-api.version>
        <jansi.version>1.18</jansi.version>
    </properties>

    <developers>
        <developer>
            <name>蒋震宇</name>
            <email>i@sunisle.org</email>
            <organization>ecfront</organization>
            <organizationUrl>http://www.ecfront.com</organizationUrl>
        </developer>
        <developer>
            <name>葛佳兴</name>
            <email>zoeminghong@163.com</email>
        </developer>
        <developer>
            <name>孙豫蕾</name>
            <email>syl_527@163.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/gudaoxuri/dew.git</connection>
        <developerConnection>scm:git:https://github.com/gudaoxuri/dew.git</developerConnection>
        <url>https://github.com/gudaoxuri/dew</url>
    </scm>

    <dependencyManagement>
        <dependencies>
            <!-- Basic -->
            <dependency>
                <groupId>com.ecfront.dew</groupId>
                <artifactId>common</artifactId>
                <version>${dew-common.version}</version>
            </dependency>
            <!-- Modules -->
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>boot-starter</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>idempotent-starter</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <!-- Cluster -->
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>cluster-common</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>cluster-spi-redis</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>cluster-spi-rabbit</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>cluster-spi-hazelcast</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>cluster-spi-mqtt</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>cluster-spi-kafka</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>hbase-starter</artifactId>
                <version>${dew.version}</version>
            </dependency>
            <!-- Doc -->
            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-ui</artifactId>
                <version>${springdoc.version}</version>
            </dependency>
            <!-- InitTest -->
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>cluster-common-test</artifactId>
                <version>${dew.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>group.idealworld.dew</groupId>
                <artifactId>test-starter</artifactId>
                <version>${dew.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>jakarta.validation</groupId>
                <artifactId>jakarta.validation-api</artifactId>
                <version>${jakarta.validation.version}</version>
            </dependency>
            <!-- Others -->
            <dependency>
                <groupId>org.apache.hbase</groupId>
                <artifactId>hbase-client</artifactId>
                <version>${hbase.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.hadoop</groupId>
                        <artifactId>hadoop-aws</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>querydsl</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.mysema.maven</groupId>
                        <artifactId>apt-maven-plugin</artifactId>
                        <version>1.1.3</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>target/generated-sources/java</outputDirectory>
                                    <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.querydsl</groupId>
                                <artifactId>querydsl-apt</artifactId>
                                <version>${querydsl.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>devops</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <skipIfEmpty>true</skipIfEmpty>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>group.idealworld.dew</groupId>
                        <artifactId>dew-maven-plugin</artifactId>
                        <version>3.0.0-Beta3</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>init</goal>
                                    <goal>release</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!--<profile>
            <id>native</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.nativeimage</groupId>
                        <artifactId>native-image-maven-plugin</artifactId>
                        <version>${graalvm.verison}</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.springframework.experimental</groupId>
                                <artifactId>spring-graalvm-native</artifactId>
                                <version>${spring-graalvm-native.verison}</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <mainClass>${main.class}</mainClass>
                            <buildArgs>-Dspring.native.remove-yaml-support=true -Dspring.spel.ignore=true</buildArgs>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>native-image</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>-->

        <profile>
            <id>release</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>oss</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>oss</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>group.idealworld.dew</groupId>
                        <artifactId>sdkgen-maven-plugin</artifactId>
                        <version>3.0.0-Beta3</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>testGen</goal>
                                    <goal>sdkGen</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <charset>${project.build.sourceEncoding}</charset>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <docencoding>${project.build.sourceEncoding}</docencoding>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <skip>${maven.deploy.skip}</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>fatjar</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>repackage</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <finalName>${finalName}</finalName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>qa</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>3.0.0</version>
                        <dependencies>
                            <dependency>
                                <groupId>com.puppycrawl.tools</groupId>
                                <artifactId>checkstyle</artifactId>
                                <version>8.18</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>checkstyle-validation</id>
                                <phase>validate</phase>
                                <configuration>
                                    <skip>${checkstyle.skip}</skip>
                                    <encoding>UTF-8</encoding>
                                    <consoleOutput>true</consoleOutput>
                                    <failsOnError>true</failsOnError>
                                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                                    <configLocation>${checkstyle.config.path}</configLocation>
                                </configuration>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>3.9.1.2184</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>oss-public</id>
            <url>https://oss.sonatype.org/content/groups/public</url>
        </repository>
        <repository>
            <id>oss-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>interval:10</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestone</id>
            <name>Spring milestone</name>
            <url>https://repo.spring.io/milestone</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>oss-public</id>
            <url>https://oss.sonatype.org/content/groups/public</url>
        </pluginRepository>
        <pluginRepository>
            <id>oss-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestone</id>
            <name>Spring milestone</name>
            <url>https://repo.spring.io/milestone</url>
        </pluginRepository>
    </pluginRepositories>

</project>
