<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>client_java</artifactId>
    <groupId>io.prometheus</groupId>
    <version>1.4.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>prometheus-metrics-exposition-formats</artifactId>
  <packaging>bundle</packaging>
  <name>Prometheus Metrics Exposition Formats</name>
  <description>Prometheus exposition formats.</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-metrics-exposition-formats-main</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>target/metrics-exposition-formats/src/main</outputDirectory>
              <resources>
                <resource>
                  <directory>../prometheus-metrics-exposition-formats/src/main</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-metrics-exposition-formats-test</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>target/metrics-exposition-formats/src/test</outputDirectory>
              <resources>
                <resource>
                  <directory>../prometheus-metrics-exposition-formats/src/test</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>regex-property</id>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
              <name>protobuf-java.string-version</name>
              <value>${protobuf-java.version}</value>
              <regex>\.</regex>
              <replacement>_</replacement>
              <failIfNoMatch>true</failIfNoMatch>
            </configuration>
          </execution>
          <execution>
            <id>add-metrics-exposition-formats-main</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/metrics-exposition-formats/src/main/java</source>
                <source>target/metrics-exposition-formats/src/main/generated</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-metrics-exposition-formats-test</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/metrics-exposition-formats/src/test/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadeSourcesContent>true</shadeSourcesContent>
              <createSourcesJar>true</createSourcesJar>
              <artifactSet>
                <includes>
                  <include>com.google.protobuf:protobuf-java</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.google.protobuf</pattern>
                  <shadedPattern>io.prometheus.metrics.shaded.com_google_protobuf_${protobuf-java.string-version}</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>com.google.protobuf:protobuf-java</artifact>
                  <excludes>
                    <exclude>META-INF/maven/com.google.protobuf/**</exclude>
                    <exclude>**/*.proto</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>javadoc</id>
    </profile>
    <profile>
      <id>release</id>
    </profile>
    <profile>
      <dependencies>
        <dependency>
          <groupId>io.prometheus</groupId>
          <artifactId>prometheus-metrics-exposition-textformats</artifactId>
          <version>${project.version}</version>
          <type>test-jar</type>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>io.prometheus</groupId>
      <artifactId>prometheus-metrics-exposition-textformats</artifactId>
      <version>1.4.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <properties>
    <automatic.module.name>io.prometheus.metrics.expositionformats</automatic.module.name>
  </properties>
</project>
