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

    <groupId>pw.krejci</groupId>
    <artifactId>jmh-maven-plugin</artifactId>
    <version>0.2.2</version>
    <packaging>maven-plugin</packaging>
    <name>JMH Maven Plugin</name>
    <description>A Maven plugin for running JMH benchmarks from the test sources.</description>
    <url>https://github.com/metlos/jmh-maven-plugin</url>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <version.maven>3.6.0</version.maven>
        <version.maven-plugin-plugin>3.6.0</version.maven-plugin-plugin>
        <version.maven-invoker>1.9</version.maven-invoker>
        <version.maven-compiler>3.8.1</version.maven-compiler>
        <version.net.revelc.code.formatter>2.12.1</version.net.revelc.code.formatter>
        <version.net.revelc.code>1.4.1</version.net.revelc.code>

        <skipTests>false</skipTests>
        <itest.debug-output>false</itest.debug-output>
        <itest.maven-opts />

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <prerequisites>
        <maven>${version.maven}</maven>
    </prerequisites>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${version.maven-compiler}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${version.maven}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${version.maven-plugin-plugin}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${version.maven}</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${version.net.revelc.code.formatter}</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${version.net.revelc.code}</version>
                <configuration>
                    <groups>java.,javax.,*</groups>
                    <staticGroups>java,javax,*</staticGroups>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>${version.maven-invoker}</version>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <skipInstallation>${skipTests}</skipInstallation>
                            <skipInvocation>${skipTests}</skipInvocation>
                            <cloneProjectsTo>${project.build.directory}/it/build</cloneProjectsTo>
                            <localRepositoryPath>${project.build.directory}/it/repo</localRepositoryPath>
                            <streamLogs>true</streamLogs>
                            <goals>
                                <goal>clean</goal>
                                <goal>install</goal>
                            </goals>
                            <mavenOpts>${itest.maven-opts}</mavenOpts>
                            <debug>${itest.debug-output}</debug>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${version.maven-plugin-plugin}</version>
                <configuration>
                    <goalPrefix>jmh</goalPrefix>
                </configuration>
                <executions>
                    <execution>
                        <id>default-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-descriptor</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>itest.debug</id>

            <properties>
                <itest.maven-opts>-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y</itest.maven-opts>
                <itest.debug-output>false</itest.debug-output>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </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>
                </plugins>
            </build>
        </profile>
    </profiles>

    <inceptionYear>2020</inceptionYear>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>Lukas Krejci</name>
        <url>http://lukas.krejci.pw</url>
    </organization>

    <developers>
        <developer>
            <name>Lukas Krejci</name>
            <email>lukas@krejci.pw</email>
            <url>http://lukas.krejci.pw</url>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <issueManagement>
        <system>github-issues</system>
        <url>https://github.com/metlos/jmh-maven-plugin/issues</url>
    </issueManagement>


    <scm>
        <connection>scm:git:git://github.com/metlos/jmh-maven-plugin.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/metlos/jmh-maven-plugin.git</developerConnection>
        <url>https://github.com/metlos/jmh-maven-plugin</url>
        <tag>jmh-maven-plugin-0.2.2</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>