<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2018 Alexey Ragozin

    Licensed 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.gridkit.lab</groupId>
        <artifactId>grid-lab-pom</artifactId>
        <version>2</version>        
    </parent>
    
    <artifactId>jvm-attach-api</artifactId>
    <version>1.5</version>        
    <name>${project.groupId}::${project.artifactId}</name>

    <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>

    <developers>
      <developer>
        <id>alexey.ragozin</id>
        <name>Alexey Ragozin</name>
        <email>alexey.ragozin@gmail.com</email>
      </developer>
    </developers>

    <scm>
      <connection>scm:git:https://github.com/gridkit/jvm-attach.git</connection>
      <developerConnection>scm:git:https://github.com/gridkit/jvm-attach.git</developerConnection>
      <url>https://github.com/gridkit/jvm-attach</url>
      <tag>jvm-attach-api-1.5</tag>
  </scm>

    <properties>
        <javaVersion>1.6</javaVersion>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.6</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.0.6</version>
            <scope>test</scope>
        </dependency>
        
    </dependencies>    

    <build>
        <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-release-plugin</artifactId>
              <version>2.4</version>
              <configuration>
                <autoVersionSubmodules>true</autoVersionSubmodules>
                <pushChanges>true</pushChanges>
              </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>${javaVersion}</source>
                    <target>${javaVersion}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.13</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-source</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration> 
            </plugin>                
        </plugins>
    </build>

    <profiles>
      <profile>
        <id>post_java9</id>
        <activation>
          <jdk>[1.9,)</jdk>
        </activation>
        <!-- no tools.jar required -->
        <dependencies />
        <build>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                <argLine>--add-exports java.base/jdk.internal.perf=ALL-UNNAMED</argLine>
              </configuration>
            </plugin>
          </plugins>
        </build>
      </profile>
      <profile>
        <id>tools_jar</id>
        <activation>
          <file>
            <exists>${java.home}/../lib/tools.jar</exists>
          </file>
        </activation>
        <dependencies>
          <dependency>
            <groupId>com.sun</groupId>
            <artifactId>tools</artifactId>
            <version>1.6</version>
            <scope>system</scope>
            <systemPath>${java.home}/../lib/tools.jar</systemPath>
            <optional>true</optional>
          </dependency>
        </dependencies>
      </profile>
    </profiles>

</project>
