<!--

    SPDX-License-Identifier: Apache-2.0

    Copyright 2020 - 2021 The JfrUnit authors.

    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

        https://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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <modules>
    <module>jfrunit-events-generator</module>
    <module>jfrunit-core</module>
  </modules>

  <parent>
    <groupId>org.moditect</groupId>
    <artifactId>moditect-org-parent</artifactId>
    <version>1.1.0.Final</version>
  </parent>

  <groupId>org.moditect.jfrunit</groupId>
  <artifactId>jfrunit-aggregator</artifactId>
  <version>1.0.0.Alpha2</version>
  <packaging>pom</packaging>

  <name>JfrUnit</name>
  <url>https://github.com/moditect/jfrunit/</url>
  <description>A JUnit extension for asserting JDK Flight Recorder events</description>
  <inceptionYear>2020</inceptionYear>

  <properties>
    <project.identifier>jfrunit</project.identifier>
    <project.github.repository>moditect/jfrunit</project.github.repository>
    <local.repository.path>/tmp/repository</local.repository.path>
    <java.version>16</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <quarkus.platform.version>2.6.0.Final</quarkus.platform.version>
    <version.surefire.plugin>3.0.0-M5</version.surefire.plugin>
    <jrfDocUrl>https://bestsolution-at.github.io/jfr-doc/openjdk-17.json</jrfDocUrl>
  </properties>

  <scm>
    <connection>scm:git:${repository.url}</connection>
    <developerConnection>scm:git:${repository.url}</developerConnection>
    <url>${repository.url}</url>
    <tag>HEAD</tag>
  </scm>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.spockframework</groupId>
        <artifactId>spock-bom</artifactId>
        <version>2.0-groovy-3.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.13.1</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>compileTests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-testCompile</id>
            <configuration>
              <release>${java.version}</release>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <trimStackTrace>false</trimStackTrace>
          <includes>
            <include>**/*Test.java</include>
            <include>**/*Spec.java</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration combine.self="override">
          <header>${rootdir}/etc/license.txt</header>
          <strictCheck>true</strictCheck>
          <excludes>
            <exclude>README.md</exclude>
            <exclude>jitpack.yml</exclude>
            <exclude>LICENSE.txt</exclude>
            <exclude>install-jdk.sh</exclude>
            <exclude>mvnw</exclude>
            <exclude>mvnw.cmd</exclude>
            <exclude>.mvn/wrapper/maven-wrapper.properties</exclude>
            <exclude>.mvn/wrapper/MavenWrapperDownloader.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <id>jreleaser</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jreleaser</groupId>
            <artifactId>jreleaser-maven-plugin</artifactId>
            <version>0.9.1</version>
            <inherited>false</inherited>
            <configuration>
              <jreleaser>
                <release>
                  <github>
                    <skipTag>true</skipTag>
                    <changelog>
                      <formatted>ALWAYS</formatted>
                      <format>- {{commitShortHash}} {{commitTitle}}</format>
                      <contributors>
                        <format>* {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}</format>
                      </contributors>
                      <hide>
                        <contributors>
                          <contributor>GitHub</contributor>
                          <contributor>bot</contributor>
                        </contributors>
                      </hide>
                      <labelers>
                        <labeler>
                          <title>Bump</title>
                          <label>dependencies</label>
                        </labeler>
                      </labelers>
                      <categories>
                        <category>
                          <title>Dependencies</title>
                          <labels>dependencies</labels>
                        </category>
                      </categories>
                    </changelog>
                  </github>
                </release>
              </jreleaser>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
