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

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>21</version>
  </parent>

  <groupId>org.apache.zipkin.proto3</groupId>
  <artifactId>zipkin-proto3</artifactId>
  <version>0.2.1</version>
  <packaging>jar</packaging>

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

    <main.basedir>${project.basedir}</main.basedir>
  </properties>

  <name>zipkin-proto3</name>
  <description>Language independent interchange format for Zipkin transports (Protocol Buffers v3)</description>
  <url>https://github.com/openzipkin/zipkin-api</url>
  <inceptionYear>2018</inceptionYear>

  <organization>
    <name>The Apache Software Foundation</name>
    <url>http://www.apache.org/</url>
  </organization>

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

  <scm>
    <url>https://github.com/apache/incubator-zipkin-api</url>
    <connection>scm:git:https://github.com/apache/incubator-zipkin-api.git</connection>
    <developerConnection>scm:git:https://github.com/apache/incubator-zipkin-api.git</developerConnection>
    <tag>v0.2.1</tag>
  </scm>

  <!-- Developer section is needed for Maven Central, but doesn't need to include each person -->
  <developers>
    <developer>
      <id>openzipkin</id>
      <name>OpenZipkin Gitter</name>
      <url>https://gitter.im/openzipkin/zipkin</url>
    </developer>
  </developers>

  <mailingLists>
    <mailingList>
      <name>Zipkin Developer List</name>
      <post>dev@zipkin.apache.org</post>
      <subscribe>dev-subscribe@zipkin.apache.org</subscribe>
      <unsubscribe>dev-unsubscribe@zipkin.apache.org</unsubscribe>
    </mailingList>
    <mailingList>
      <name>Zipkin Commits</name>
      <post>commits@zipkin.apache.org</post>
      <subscribe>commits-subscribe@zipkin.apache.org</subscribe>
      <unsubscribe>commits-unsubscribe@zipkin.apache.org</unsubscribe>
    </mailingList>
  </mailingLists>

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

  <issueManagement>
    <system>Github</system>
    <url>https://github.com/apache/incubator-zipkin-api/issues</url>
  </issueManagement>

  <dependencies>
    <!-- no dependencies as this is just proto -->
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>.</directory>
        <includes>
          <include>zipkin.proto</include>
        </includes>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <!-- mvn -N io.takari:maven:wrapper generates the ./mvnw script -->
        <plugin>
          <groupId>io.takari</groupId>
          <artifactId>maven</artifactId>
          <version>0.7.5</version>
          <configuration>
            <maven>3.6.1</maven>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <header>${main.basedir}/src/etc/header.txt</header>
          <mapping>
            <!-- Don't use javadoc style as this makes code formatters break it by adding tags! -->
            <java>SLASHSTAR_STYLE</java>
          </mapping>
          <excludes>
            <exclude>.travis.yml</exclude>
            <exclude>.gitignore</exclude>
            <exclude>.gitattributes</exclude>
            <exclude>.mvn/**</exclude>
            <exclude>mvnw*</exclude>
            <exclude>etc/header.txt</exclude>
            <exclude>**/.idea/**</exclude>
            <exclude>LICENSE</exclude>
            <exclude>DISCLAIMER</exclude>
            <exclude>DEPENDENCIES</exclude>
            <exclude>NOTICE</exclude>
            <exclude>Jenkinsfile</exclude>
            <exclude>package.json</exclude>
            <exclude>**/*.md</exclude>
          </excludes>
          <strictCheck>true</strictCheck>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M2</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[1.8,12)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.13</version>
        <configuration>
          <excludes>
            <exclude>**/target/**</exclude>

            <!-- IDE files -->
            <exclude>**/*.iml</exclude>
            <exclude>**/.idea/**</exclude>
            <exclude>**/*.classpath</exclude>
            <exclude>**/.project</exclude>
            <exclude>**/.settings/**</exclude>
            <exclude>**/dependency-reduced-pom.xml</exclude>

            <!-- git files -->
            <exclude>**/.gitignore</exclude>
            <exclude>**/.gitmodules</exclude>
            <exclude>**/.git/**</exclude>

            <!-- CI files -->
            <exclude>**/.travis.yml</exclude>

            <!-- GitHub files -->
            <exclude>**/.github/**</exclude>

            <!-- document files -->
            <exclude>**/*.md</exclude>

            <!-- NPM files -->
            <exclude>**/package.json</exclude>

            <!-- Maven Wrapper generated files -->
            <exclude>.mvn/wrapper/maven-wrapper.properties</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>apache-release</id>
      <build>
        <plugins>
          <!-- Creates empty javadoc jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <id>empty-javadoc-jar</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <classifier>javadoc</classifier>
                  <classesDirectory>${basedir}/javadoc</classesDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>source-release-assembly</id>
                <configuration>
                  <!-- make the source release zip includes the word incubating -->
                  <finalName>apache-zipkin-api-incubating-${project.version}</finalName>
                  <descriptors>
                    <descriptor>src/main/assemblies/source-release.xml</descriptor>
                  </descriptors>
                  <!-- don't inherit the source-release as we are overriding it -->
                  <descriptorRefs combine.self="override" />
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
