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

    <groupId>com.jdcloud.jmsf</groupId>
    <artifactId>meshware-parent</artifactId>
    <version>1.1.0</version>
    <packaging>pom</packaging>
    <name>JMSF - MeshWare Parent pom</name>
    <description>JMSF - JDT Mesh Service governance sdk for java</description>

    <modules>
        <module>meshware-dependencies</module>
        <module>meshware-common</module>
        <module>meshware-core</module>
        <module>meshware-extensions</module>
        <module>meshware-registry</module>
        <module>meshware-config</module>
        <module>meshware-spring</module>
        <module>meshware-circuitbreaker</module>
        <module>meshware-ratelimiter</module>
        <module>meshware-trace</module>
        <module>meshware-samples</module>
    </modules>

    <organization>
        <name>JMSF</name>
        <url>https://www.jdcloud.com</url>
    </organization>
    <inceptionYear>2021</inceptionYear>
    <url>https://www.jdcloud.com</url>
    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>Apache License Version 2.0</comments>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>chenzhiguo</id>
            <name>Zhiguo.Chen</name>
            <organization>JDCloud</organization>
            <organizationUrl>https://www.jdcloud.com</organizationUrl>
        </developer>
    </developers>
    <scm>
        <tag>main</tag>
        <connection>scm:git:https://github.com/jdcloud-jmsf/meshware-java.git</connection>
        <developerConnection>scm:git:https://github.com/jdcloud-jmsf/meshware-java.git</developerConnection>
        <url>scm:git:https://github.com/jdcloud-jmsf</url>
    </scm>

    <properties>
        <jdk.version>1.8</jdk.version>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-versions-plugin.version>2.7</maven-versions-plugin.version>
        <puppycrawl-tools-checkstyle.version>8.45.1</puppycrawl-tools-checkstyle.version>
        <spring-cloud-build-checkstyle.branch>master</spring-cloud-build-checkstyle.branch>
        <checkstyle.suppressions.file>
            https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/${spring-cloud-build-checkstyle.branch}/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml
        </checkstyle.suppressions.file>
        <!--suppress UnresolvedMavenProperty -->
        <checkstyle.additional.suppressions.file>
            ${maven.multiModuleProjectDirectory}/src/checkstyle/checkstyle-suppressions.xml
        </checkstyle.additional.suppressions.file>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.jdcloud.jmsf</groupId>
                <artifactId>meshware-dependencies</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>jdk8</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
                <maven.javadoc.quiet>true</maven.javadoc.quiet>
            </properties>
        </profile>
        <!-- For jdk 11 above JavaEE annotation -->
        <profile>
            <id>javax.annotation</id>
            <activation>
                <jdk>[1.11,)</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.annotation</groupId>
                    <artifactId>javax.annotation-api</artifactId>
                    <version>1.3.2</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>sonatype-oss-release</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>${maven-deploy-plugin.version}</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <excludes>
                                <exclude>com/jdcloud/**</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <configuration>
                            <source>${jdk.version}</source>
                            <target>${jdk.version}</target>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <compilerArgument>-parameters</compilerArgument>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>${maven-resources-plugin.version}</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>${maven-dependency-plugin.version}</version>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>${maven-versions-plugin.version}</version>
                        <configuration>
                            <generateBackupPoms>false</generateBackupPoms>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <configuration>
                            <mavenExecutorId>forked-path</mavenExecutorId>
                            <useReleaseProfile>false</useReleaseProfile>
                            <arguments>${arguments} -Psonatype-oss-release</arguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>jdcloud</id>
                    <name>OSS Snapshots Repository</name>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>jdcloud</id>
                    <name>OSS Staging Repository</name>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                                    <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums
                                        respectively.
                                    </message>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <arguments>-P restricted-release,sonatype-oss-release,full</arguments>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <allowTimestampedSnapshots>false</allowTimestampedSnapshots>
                    <tagNameFormat>${project.artifactId}-@{project.version}</tagNameFormat>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-api</artifactId>
                        <version>1.9.4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.4</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${puppycrawl-tools-checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle-validation</id>
                        <phase>validate</phase>
                        <inherited>true</inherited>
                        <configuration>
                            <skip>false</skip>
                            <configLocation>checkstyle.xml</configLocation>
                            <!--                            <headerLocation>checkstyle-header.txt</headerLocation>-->
                            <propertyExpansion>
                                checkstyle.build.directory=${project.build.directory}
                                checkstyle.suppressions.file=${checkstyle.suppressions.file}
                                checkstyle.additional.suppressions.file=${checkstyle.additional.suppressions.file}
                            </propertyExpansion>
                            <consoleOutput>true</consoleOutput>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <failsOnError>true</failsOnError>
                            <failOnViolation>true</failOnViolation>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.2</version>
            </plugin>
        </plugins>
    </reporting>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.5.2</version>
            <type>maven-plugin</type>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>${maven-deploy-plugin.version}</version>
            <type>maven-plugin</type>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>snapshots</id>
            <name>JD maven2 repository-snapshots</name>
            <url>http://artifactory.jd.com/libs-snapshots-local</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/groups/public/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>
