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

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>5</version>
    <relativePath />
  </parent>
  <groupId>io.github.stephankoelle</groupId>
  <artifactId>jamm</artifactId>
  <packaging>jar</packaging>
  <version>0.4.1</version>
  <name>Java Agent for Memory Measurements</name>
  <description>
    Jamm provides MemoryMeter, a java agent to measure actual object memory use including JVM overhead.
  </description>
  <url>https://github.com/stephankoelle/jamm/</url>
  <scm>
    <connection>scm:git:git://github.com/stephankoelle/jamm.git</connection>
    <developerConnection>scm:git:git@github.com:stephankoelle/jamm.git</developerConnection>
    <url>http://github.com/stephankoelle/jamm/tree/master/</url>
    <tag>v0.4.1</tag>
  </scm>
  <issueManagement>
    <system>github</system>
    <url>http://github.com/stephankoelle/jamm/issues</url>
  </issueManagement>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <properties>
    <openjdk.jmh.version>1.24</openjdk.jmh.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>${openjdk.jmh.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>${openjdk.jmh.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <developers>
    <developer>
      <!-- see https://github.com/jbellis/jamm/pull/3 as to why I am publisher -->
      <id>stephenc</id>
      <name>Stephen Connolly</name>
      <roles>
        <role>publisher</role>
      </roles>
    </developer>
    <developer>
      <id>jbellis</id>
      <name>Jonathan Ellis</name>
      <roles>
        <role>architect</role>
      </roles>
    </developer>
    <developer>
      <id>belliottsmith</id>
      <name>Benedict Elliott Smith</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>mebigfatguy</id>
      <name>Dave Brosius</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>mshuler</id>
      <name>Michael Shuler</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>stephankoelle</id>
      <name>Stephan Kölle</name>
      <roles>
        <role>developer</role>
        <role>publisher</role>
      </roles>
    </developer>
    <developer>
      <id>snazy</id>
      <name>Robert Stupp</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>
  <build>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <testSourceDirectory>${basedir}/test</testSourceDirectory>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.4</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Premain-Class>org.github.jamm.MemoryMeter</Premain-Class>
            </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skipTests>true</skipTests>
          <forkCount>1</forkCount>
          <reuseForks>false</reuseForks>
          <argLine>-javaagent:${project.build.directory}/${project.build.finalName}-tests.${project.packaging}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <finalName>benchmarks</finalName>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>org.openjdk.jmh.Main</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </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>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</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-release-plugin</artifactId>
        <configuration>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <preparationGoals>clean install</preparationGoals>
          <goals>deploy</goals>
        </configuration>
        <version>3.0.0-M4</version>
      </plugin>

    </plugins>
  </build>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
</project>
