<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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="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>group.rxcloud</groupId>
    <artifactId>cloud-runtimes</artifactId>
    <packaging>pom</packaging>
    <version>1.11-alpha-1</version>

    <name>cloud-runtimes-jvm</name>
    <description>Cloud Runtimes Specification for the JVM.</description>
    <url>https://github.com/reactivegroup</url>

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

    <developers>
        <developer>
            <name>kevinten10</name>
            <email>596823919@qq.com</email>
        </developer>
        <developer>
            <name>pinxiong</name>
            <email>pinxiong.cn@gmail.com</email>
        </developer>
        <developer>
            <name>reckless11</name>
            <email>reckless0511@gmail.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:reactivegroup/cloud-runtimes-jvm.git</connection>
        <developerConnection>scm:git:git@github.com:reactivegroup/cloud-runtimes-jvm.git</developerConnection>
        <url>git@github.com:reactivegroup/cloud-runtimes-jvm.git</url>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <modules>
        <module>cloud-runtimes-api</module>
    </modules>

    <properties>
        <java.version>8</java.version>
        <file.encoding>UTF-8</file.encoding>
        <maven.version>3.8.1</maven.version>
        <reactor-core.version>3.3.22.RELEASE</reactor-core.version>
        <open.telemetry.version>1.9.0</open.telemetry.version>
        <open.telemetry.version.alpha>1.9.0-alpha</open.telemetry.version.alpha>
        <junit.version>5.3.1</junit.version>

        <checkstyle.version>3.1.2</checkstyle.version>
        <checkstyle.skip>false</checkstyle.skip>
        <apache.rat.version>0.13</apache.rat.version>
        <cobertura.maven.version>2.7</cobertura.maven.version>
        <maven.surefire.version>3.0.0-M1</maven.surefire.version>
        <maven.jacoco.version>0.8.6</maven.jacoco.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>cloud-runtimes-api</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- open telemetry -->
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-bom</artifactId>
                <version>${open.telemetry.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
                <optional>true</optional>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <!-- jacoco: mvn verify -Pjacoco  -->
        <profile>
            <id>jacoco</id>
            <properties>
                <jacoco.skip>false</jacoco.skip>
            </properties>
        </profile>
        <!-- check apache license: mvn validate -Prat  -->
        <profile>
            <id>rat</id>
            <properties>
                <rat.skip>false</rat.skip>
            </properties>
        </profile>
        <!-- check code style: mvn validate -Pcheckstyle  -->
        <profile>
            <id>checkstyle</id>
            <properties>
                <checkstyle.skip>false</checkstyle.skip>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-checkstyle</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/codestyle</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/codestyle</directory>
                                    <includes>
                                        <include>*</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.41</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle-validation</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>codestyle/checkstyle.xml</configLocation>
                            <suppressionsLocation>codestyle/checkstyle-suppressions.xml</suppressionsLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failOnViolation>true</failOnViolation>
                            <skip>${checkstyle.skip}</skip>
                            <excludes>
                                **/generated/**/*,
                                **/target/**/*,
                                **/*.json
                                **/*.sh
                            </excludes>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <detectOfflineLinks>true</detectOfflineLinks>
                    <breakiterator>true</breakiterator>
                    <version>false</version>
                    <author>false</author>
                    <show>public</show>
                    <charset>UTF-8</charset>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <excludePackageNames>
                        <!-- No public or protected classes found to document
                            All of excluded package names will be removed if there is any public or protected classes
                        -->
                        group.rxcloud.cloudruntimes.springboot,group.rxcloud.cloudruntimes.springboot.*
                    </excludePackageNames>
                    <!-- Exclude all source code related test -->
                    <sourceFileExcludes>
                        <exclude>**/example/**/*.java</exclude>
                        <exclude>**/generated/**/*.java</exclude>
                        <exclude>**/*Benchmark.java</exclude>
                        <exclude>**/*Bench.java</exclude>
                        <exclude>**/*Test.java</exclude>
                    </sourceFileExcludes>
                    <doctitle>Cloud Runtimes ${project.version} API</doctitle>
                    <windowtitle>Cloud Runtimes ${project.version} API</windowtitle>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>${apache.rat.version}</version>
                <executions>
                    <execution>
                        <id>rat-validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**/*.versionsBackup</exclude>
                        <exclude>**/.idea/</exclude>
                        <exclude>**/*.iml</exclude>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/*.load</exclude>
                        <exclude>**/*.flex</exclude>
                        <exclude>**/*.fc</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*.sh</exclude>
                        <exclude>**/*.bat</exclude>
                        <exclude>**/*.md</exclude>
                        <exclude>.git/</exclude>
                        <exclude>.gitignore</exclude>
                        <!-- ASF jenkins box puts the Maven repo in our root directory. -->
                        <exclude>.repository/</exclude>
                        <exclude>**/.settings/*</exclude>
                        <exclude>**/.classpath</exclude>
                        <exclude>**/.project</exclude>
                        <exclude>**/target/**</exclude>
                        <exclude>**/*.log</exclude>
                        <exclude>.codecov.yml</exclude>
                        <exclude>.travis.yml</exclude>
                        <exclude>PULL_REQUEST_TEMPLATE.md</exclude>
                        <exclude>CONTRIBUTING.md</exclude>
                        <exclude>README.md</exclude>
                        <exclude>Jenkinsfile</exclude>
                        <exclude>**/codestyle/*</exclude>
                        <exclude>**/resources/META-INF/**</exclude>
                        <exclude>.github/**</exclude>
                        <exclude>codestyle/**</exclude>
                        <exclude>**/generated/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>${cobertura.maven.version}</version>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                    <check/>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${maven.jacoco.version}</version>
                <executions>
                    <!-- Prepares the property pointing to the JaCoCo runtime agent
                    which is passed as VM argument when Maven the Surefire plugin is executed. -->
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <!-- Ensures that the code coverage report is created after
                    all tests have been run. -->
                    <execution>
                        <id>generate-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>



