<?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>parent</artifactId>
    <groupId>io.prometheus.jmx</groupId>
    <version>0.16.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>jmx_prometheus_javaagent</artifactId>
  <name>Prometheus JMX Exporter - Java Agent</name>
  <description>See https://github.com/prometheus/jmx_exporter/blob/master/README.md</description>
  <url>http://github.com/prometheus/jmx_exporter</url>
  <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>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <shadedPattern>io.prometheus.jmx.shaded.</shadedPattern>
                  <includes>
                    <include>org.yaml.**</include>
                  </includes>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>io.prometheus.jmx:jmx_prometheus_javaagent_java6</artifact>
                  <excludes>
                    <exclude>io/prometheus/jmx/shaded/org/yaml/snakeyaml/**</exclude>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                  <includes>
                    <include>**</include>
                  </includes>
                </filter>
              </filters>
              <transformers>
                <transformer>
                  <manifestEntries>
                    <Premain-Class>io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent</Premain-Class>
                    <Agent-Class>io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent</Agent-Class>
                    <Implementation-Version>${project.version}</Implementation-Version>
                    <Implementation-Title>${project.artifactId}</Implementation-Title>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
                <configuration>
                  <includePom>true</includePom>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.3.0</version>
            <executions>
              <execution>
                <id>generate-javadoc-site-report</id>
                <phase>site</phase>
                <goals>
                  <goal>aggregate</goal>
                </goals>
                <configuration>
                  <encoding>UTF-8</encoding>
                  <docencoding>UTF-8</docencoding>
                  <linksource>true</linksource>
                  <source>8</source>
                </configuration>
              </execution>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <includeDependencySources>true</includeDependencySources>
                  <dependencySourceIncludes>
                    <dependencySourceInclude>io.prometheus.jmx:jmx_prometheus_javaagent_java6</dependencySourceInclude>
                  </dependencySourceIncludes>
                  <encoding>UTF-8</encoding>
                  <docencoding>UTF-8</docencoding>
                  <linksource>true</linksource>
                  <source>8</source>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <encoding>UTF-8</encoding>
              <docencoding>UTF-8</docencoding>
              <linksource>true</linksource>
              <source>8</source>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <properties>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>
