<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2017 Huawei Technologies Co., Ltd
  ~
  ~ 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="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>io.servicecomb</groupId>
  <artifactId>java-chassis</artifactId>
  <version>0.5.0</version>
  <packaging>pom</packaging>

  <name>ServiceComb Java Chassis</name>
  <description>Software Development Kit (SDK) for rapid development of microservices</description>
  <url>https://github.com/ServiceComb/java-chassis</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

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

  <developers>
    <developer>
      <name>The ServiceComb Developer Team</name>
      <email>dev@servicecomb.io</email>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/ServiceComb/java-chassis</url>
    <connection>scm:git:https://github.com/ServiceComb/java-chassis.git</connection>
    <developerConnection>scm:git:https://github.com/ServiceComb/java-chassis.git</developerConnection>
    <tag>v${project.version}</tag>
  </scm>

  <modules>
    <module>parent</module>
    <module>java-chassis-dependencies</module>
    <module>common</module>
    <module>foundations</module>
    <module>handlers</module>
    <module>providers</module>
    <module>transports</module>
    <module>swagger</module>
    <module>core</module>
    <module>service-registry</module>
    <module>spring-boot-starter</module>
    <module>tracing</module>
    <module>edge</module>
  </modules>

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

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
	    <executions>
             <execution>
               <id>default-deploy</id>
               <phase>deploy</phase>
               <goals>
                 <goal>deploy</goal>
               </goals>
             </execution>
            </executions>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
              <skipLocalStaging>true</skipLocalStaging>
            </configuration>
        </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.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <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-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <useReleaseProfile>false</useReleaseProfile>
              <releaseProfiles>release</releaseProfiles>
              <goals>deploy</goals>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>it</id>
      <modules>
        <module>demo</module>
        <module>integration-tests</module>
      </modules>
    </profile>
    <profile>
      <id>distribution</id>
      <modules>
        <module>java-chassis-distribution</module>
      </modules>
    </profile>
    <profile>
      <id>coverage</id>
      <modules>
        <module>coverage-reports</module>
      </modules>
    </profile>
    <profile>
      <id>samples</id>
      <modules>
        <module>samples</module>
      </modules>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
          <skip>${maven.test.skip}</skip>
          <testFailureIgnore>${maven.test.failure.ignore}</testFailureIgnore>
          <excludes>
            <exclude>${excludesFile}</exclude>
          </excludes>
          <forkCount>2</forkCount>
          <reuseForks>true</reuseForks>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <findbugsXmlOutput>true</findbugsXmlOutput>
          <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
          <xmlOutput>true</xmlOutput>
          <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eluder.coveralls</groupId>
          <artifactId>coveralls-maven-plugin</artifactId>
          <version>4.3.0</version>
          <configuration>
            <jacocoReports>
              <jacocoReport>${project.basedir}/coverage-reports/target/site/jacoco-aggregate/jacoco.xml</jacocoReport>
            </jacocoReports>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
