<!--
  ~ Copyright (C) 2020, K2N.IO.
  ~
  ~ This library is free software; you can redistribute it and/or
  ~ modify it under the terms of the GNU Lesser General Public
  ~ License as published by the Free Software Foundation; either
  ~ version 2.1 of the License, or (at your option) any later version.
  ~
  ~ This library is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this library; if not, write to the Free Software
  ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  ~
  -->
<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>
    <groupId>com.gocypher.cybench.launcher.plugin</groupId>
    <artifactId>cybench-launcher-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <version>1.0.2</version>
    <name>cybench-launcher-maven-plugin</name>

    <url>https://github.com/K2NIO/gocypher-cybench-maven</url>
    <description>Maven plugin designed to execute JMH benchmarks, collect results, add environment properties, build
        report and store it into external repository for further analysis.
    </description>
    <licenses>
        <license>
            <name>GNU Lesser General Public License v2.1</name>
            <url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
        </license>
    </licenses>
    <organization>
        <name>K2N.IO</name>
        <url>https://cybench.io</url>
    </organization>
    <developers>
        <developer>
            <name>CyBench Team</name>
            <email>info@cybench.io</email>
            <organization>K2N.IO</organization>
            <organizationUrl>https://cybench.io</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/K2NIO/gocypher-cybench-maven</connection>
        <developerConnection>scm:git:git//github.com/K2NIO/gocypher-cybench-maven</developerConnection>
        <url>https://github.com/K2NIO/gocypher-cybench-maven</url>
    </scm>

    <distributionManagement>
        <repository>
            <id>oss.sonatype.org</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>oss.sonatype.org</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <project.resources.encoding>UTF-8</project.resources.encoding>
        <javac.target>1.8</javac.target>
        <release.deploy.dir>./release</release.deploy.dir>
        <version.plugin.source>3.2.1</version.plugin.source>
        <version.plugin.javadoc>3.0.1</version.plugin.javadoc>
        <version.plugin.gpg>1.6</version.plugin.gpg>
        <product.name.hr>CyBench-client</product.name.hr>
        <product.copyright.html>
            <![CDATA[<font size="-1">Copyright &#169; 2014-2020 ${project.organization.name}. All Rights Reserved.</font>]]>
        </product.copyright.html>

        <maven.source.skip>true</maven.source.skip>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <assembly.skipAssembly>true</assembly.skipAssembly>
        <gpg.skip>true</gpg.skip>
    </properties>

    <repositories>
        <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <id>pack-bin</id>
            <properties>
                <assembly.skipAssembly>false</assembly.skipAssembly>
            </properties>
        </profile>
        <profile>
            <id>pack-all</id>
            <properties>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <assembly.skipAssembly>false</assembly.skipAssembly>
            </properties>
        </profile>
        <profile>
            <id>pack-maven</id>
            <properties>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
            </properties>
        </profile>
        <profile>
            <id>maven-release</id>
            <properties>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <gpg.skip>false</gpg.skip>
            </properties>
            <build>
                <defaultGoal>clean deploy</defaultGoal>

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>3.2.0</version>
                        <configuration>
                            <encoding>${project.build.sourceEncoding}</encoding>
                        </configuration>
                    </plugin>
                    <!-- Attach source jars-->
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.plugin.source}</version>
                        <executions>
                            <execution>
                                <id>attach-source</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.plugin.javadoc}</version>
                        <configuration>
                            <doctitle>${product.name.hr}</doctitle>
                            <windowtitle>${product.name.hr}</windowtitle>
                            <header>Version ${project.version}</header>
                            <bottom>${product.copyright.html}</bottom>
                            <show>protected</show>
                            <use>true</use>
                            <notree>false</notree>
                            <nonavbar>false</nonavbar>
                            <noindex>false</noindex>
                            <splitindex>true</splitindex>
                            <author>true</author>
                            <version>true</version>
                            <nodeprecatedlist>false</nodeprecatedlist>
                            <nodeprecated>false</nodeprecated>
                            <failOnError>false</failOnError>
                            <doclint>all</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>build-javadocs-module</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Sign artifacts for uploading to Maven Central Repo -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.plugin.gpg}</version>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                            <keyname>${gpg.keyname}</keyname>
                            <passphraseServerId>${gpg.keyname}</passphraseServerId>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>oss.sonatype.org</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                        <executions>
                            <execution>
                                <id>deploy-to-sonatype</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>2.8.2</version>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>2.8.1</version>
                        <configuration>
                            <generateBackupPoms>false</generateBackupPoms>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.3.9</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>plexus-component-annotations</artifactId>
                    <groupId>org.codehaus.plexus</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-lang3</artifactId>
                    <groupId>org.apache.commons</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.4</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>maven-artifact</artifactId>
                    <groupId>org.apache.maven</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.3.9</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>guava</artifactId>
                    <groupId>com.google.guava</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-lang3</artifactId>
                    <groupId>org.apache.commons</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>plexus-utils</artifactId>
                    <groupId>org.codehaus.plexus</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.gocypher.cybench.client</groupId>
            <artifactId>gocypher-cybench-runner</artifactId>
            <version>1.3.0</version>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>clean install</defaultGoal>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <compilerVersion>${javac.target}</compilerVersion>
                    <source>${javac.target}</source>
                    <target>${javac.target}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
