<?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>jolokia-agent-parent</artifactId>
    <groupId>org.jolokia</groupId>
    <version>1.7.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.jolokia</groupId>
  <artifactId>jolokia-jvm</artifactId>
  <name>jolokia-jvm</name>
  <version>1.7.0</version>
  <description>JVM-agent</description>
  <build>
    <testResources>
      <testResource>
        <filtering>true</filtering>
        <directory>src/test/resources</directory>
        <includes>
          <include>**/*.properties</include>
        </includes>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
        <excludes>
          <exclude>**/*.properties</exclude>
        </excludes>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <shadedPattern>org.jolokia.shaded.</shadedPattern>
                  <includes>
                    <include>org.json.simple.**</include>
                  </includes>
                  <excludes>
                    <exclude>org.jolokia.shaded.**</exclude>
                  </excludes>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>com.sun:tools</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer>
                  <manifestEntries>
                    <Premain-Class>org.jolokia.jvmagent.JvmAgent</Premain-Class>
                    <Agent-Class>org.jolokia.jvmagent.JvmAgent</Agent-Class>
                    <Main-Class>org.jolokia.jvmagent.client.AgentLauncher</Main-Class>
                    <Can-Redefine-Classes>false</Can-Redefine-Classes>
                    <Can-Retransform-Classes>false</Can-Retransform-Classes>
                    <Can-Set-Native-Method-Prefix>false</Can-Set-Native-Method-Prefix>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkCount>1</forkCount>
          <reuseForks>false</reuseForks>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>default-tools-1.8.jar</id>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.8</version>
          <scope>system</scope>
          <systemPath>/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>default-tools-1.7.jar</id>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.7</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>default-tools-1.6.jar</id>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.6</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>dist</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.vafer</groupId>
            <artifactId>jdeb</artifactId>
            <version>1.0</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>jdeb</goal>
                </goals>
                <configuration>
                  <dataSet>
                    <data>
                      <src>/private/tmp/jolokia/target/checkout/agent/jvm/target/jolokia-jvm-1.7.0.jar</src>
                      <type>file</type>
                      <mapper>
                        <type>perm</type>
                        <prefix>/usr/share/jolokia</prefix>
                        <filemode>644</filemode>
                      </mapper>
                    </data>
                    <data>
                      <type>link</type>
                      <symlink>true</symlink>
                      <linkName>/usr/share/jolokia/jolokia-jvm.jar</linkName>
                      <linkTarget>/usr/share/jolokia/jolokia-jvm-1.7.0.jar</linkTarget>
                    </data>
                  </dataSet>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>4.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.8.8</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>bsh</artifactId>
          <groupId>org.beanshell</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jcommander</artifactId>
          <groupId>com.beust</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
      <version>6.1.26</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>jetty-util</artifactId>
          <groupId>org.mortbay.jetty</groupId>
        </exclusion>
        <exclusion>
          <artifactId>servlet-api</artifactId>
          <groupId>org.mortbay.jetty</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jolokia</groupId>
      <artifactId>jolokia-test-util</artifactId>
      <version>1.7.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.8</version>
      <scope>system</scope>
      <systemPath>/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/../lib/tools.jar</systemPath>
    </dependency>
  </dependencies>
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>dependencies</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
  <properties>
    <jvm.algorithm>SunX509</jvm.algorithm>
  </properties>
</project>
