<?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>dev.skilltreeplatform</groupId>
    <artifactId>call-stack-profiler</artifactId>
    <version>1.1.2</version>

    <name>Call Stack Profiler</name>
    <description>This profiler keeps track of the method calls and outputs method call hierarchy, allowing developers to quickly comprehend execution time breakdown. Profile your code with negligible performance and memory overhead.</description>
    <url>https://github.com/NationalSecurityAgency/call-stack-profiler</url>
    <scm>
        <url>https://github.com/NationalSecurityAgency/call-stack-profiler</url>
        <connection>scm:git:git://github.com/NationalSecurityAgency/call-stack-profiler</connection>
        <developerConnection>scm:git:git@github.com:NationalSecurityAgency/call-stack-profiler.git</developerConnection>
    </scm>
    <developers>
        <developer>
            <email>sudo.may1@gmail.com</email>
            <name>Dima May</name>
            <url>https://github.com/sudo-may</url>
            <id>sudo-may</id>
        </developer>
        <developer>
            <email>ryan.mayo@softtech-solutions.com</email>
            <name>Ryan Mayo</name>
            <url>https://github.com/rmmayo</url>
            <id>rmmayo</id>
        </developer>
        <developer>
            <email>chris.moses@softtech-solutions.com</email>
            <name>Chris Moses</name>
            <url>https://github.com/mosefer</url>
            <id>mosefer</id>
        </developer>
    </developers>

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

    <properties>
        <groovy.version>3.0.7</groovy.version>
        <spock.myVersion>2.0-M4-groovy-3.0</spock.myVersion>

        <groovy.eclipse.compiler.version>3.6.0-03</groovy.eclipse.compiler.version>
        <!-- This should match groovy.version        -->
        <groovy.eclipse.batch.version>3.0.7-01</groovy.eclipse.batch.version>

        <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
        <commons.lang3.version>3.11</commons.lang3.version>
        <joda.time.version>2.10.6</joda.time.version>
        <log4j.version>2.13.3</log4j.version>

        <versions.maven.plugin>2.7</versions.maven.plugin>
        <maven.scm.plugin>1.11.2</maven.scm.plugin>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
            <scope>provided</scope>
            <type>pom</type>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons.lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda.time.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-bom</artifactId>
            <version>${log4j.version}</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>${spock.myVersion}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>${groovy.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- groovy plugin -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                    <compilerArguments>
                        <indy/>
                        <configScript>config.groovy</configScript>
                    </compilerArguments>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>${groovy.eclipse.compiler.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>${groovy.eclipse.batch.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                        <version>${groovy.version}</version>
                        <type>pom</type>
                        <exclusions>
                            <exclusion>
                                <groupId>org.codehaus.groovy</groupId>
                                <artifactId>groovy-testng</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions.maven.plugin}</version>
            </plugin>


            <!-- shading had number of issues, specifically with shading slf4j, may revisit in the future -->
            <!--<plugin>-->
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <!--<artifactId>maven-shade-plugin</artifactId>-->
                <!--<version>3.1.0</version>-->
                <!--<executions>-->
                    <!--<execution>-->
                        <!--<phase>package</phase>-->
                        <!--<goals>-->
                            <!--<goal>shade</goal>-->
                        <!--</goals>-->
                        <!--<configuration>-->
                            <!--<filters>-->
                                <!--<filter>-->
                                    <!--<includes>-->
                                        <!--<include>org.apache</include>-->
                                        <!--<include>org.joda</include>-->
                                    <!--</includes>-->
                                <!--</filter>-->
                            <!--</filters>-->
                            <!--<minimizeJar>true</minimizeJar>-->
                            <!--<relocations>-->
                                <!--<relocation>-->
                                    <!--<pattern>org.apache</pattern>-->
                                    <!--<shadedPattern>orgShaded.apache</shadedPattern>-->
                                <!--</relocation>-->
                                <!--&lt;!&ndash;<relocation>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<pattern>org.slf4j</pattern>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<shadedPattern>orgShaded.slf4j</shadedPattern>&ndash;&gt;-->
                                <!--&lt;!&ndash;</relocation>&ndash;&gt;-->
                                <!--<relocation>-->
                                    <!--<pattern>org.joda</pattern>-->
                                    <!--<shadedPattern>orgShaded.joda</shadedPattern>-->
                                <!--</relocation>-->
                            <!--</relocations>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                <!--</executions>-->
            <!--</plugin>-->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                    <includes>
                        <include>**/*Spec*.java</include>
                        <include>**/*Test.java</include>
                        <include>**/*Tests.java</include>
                        <include>**/*Spec*.groovy</include>
                        <include>**/*Test.groovy</include>
                        <include>**/*Tests.groovy</include>
                    </includes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
            </plugin>

            <plugin>
                <!--                mvn license:add-third-party-->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.0.0</version>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <phase>package</phase>
                        <goals>
                            <goal>add-third-party</goal>
                        </goals>
                        <configuration>
                            <!-- will use backend/src/license/THIRD-PARTY.properties -->
                            <useMissingFile>true</useMissingFile>

                            <!--  If true enforces excluding transitive dependencies of the excluded artifacts in the reactor;
                                    otherwise only artifacts that match exclude filters are excluded.
                                       works in conjunction with excludedScopes-->
                            <excludeTransitiveDependencies>true</excludeTransitiveDependencies>
                            <excludedScopes>test,provided</excludedScopes>

                            <!-- white list of licenses, build will fail if a 3rd party licences is not found in this list -->
                            <failIfWarning>true</failIfWarning>
                            <failOnMissing>true</failOnMissing>
                            <includedLicenses>
                                <includedLicense>The Apache Software License, Version 2.0</includedLicense>
                                <includedLicense>MIT License</includedLicense>
                                <includedLicense>Eclipse Public License - Version 1.0</includedLicense>
                                <includedLicense>Eclipse Public License - Version 2.0</includedLicense>
                                <includedLicense>The 3-Clause BSD License</includedLicense>
                                <includedLicense>The BSD License</includedLicense>
                                <includedLicense>GNU Lesser General Public License</includedLicense>
                            </includedLicenses>
                            <licenseMerges>
                                <licenseMerge>The Apache Software License, Version 2.0|Apache License, Version 2.0|The Apache License, Version 2.0|The Apache Software License, version 2.0</licenseMerge>
                                <licenseMerge>Eclipse Public License - Version 1.0|Eclipse Public License 1.0</licenseMerge>
                                <licenseMerge>Eclipse Public License - Version 2.0|Eclipse Public License v2.0</licenseMerge>
                                <licenseMerge>The 3-Clause BSD License|New BSD License|BSD Licence 3|BSD License 3</licenseMerge>
                            </licenseMerges>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!--                mvn com.mycila:license-maven-plugin:3.0:check
                                    mvn com.mycila:license-maven-plugin:3.0:format-->
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <header>${basedir}/src/license/LICENSE-HEADER.txt</header>
                    <excludes>
                        <exclude>**/*.xml</exclude>
                        <exclude>**/*.jks</exclude>
                        <exclude>**/*.ftl</exclude>
                        <exclude>src/main/resources/public/**</exclude>
                        <exclude>**/license/*.properties</exclude>
                        <exclude>LICENSE.txt</exclude>
                        <exclude>.github/**</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>check</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>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

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


    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- ******************* Distribution Management ******************* -->

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

</project>
