<?xml version="1.0" encoding="UTF-8"?>
<!--

    © Copyright 2017-2022 Micro Focus or one of its affiliates.
    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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.hpe.adm.octane.ideplugins</groupId>
    <artifactId>octane-plugin-common</artifactId>
    <version>1.8.1</version>
    <packaging>jar</packaging>

    <name>ALM Octane IDE Plugins Common</name>
    <description>
        Service layer for ALM Octane IDE Plugins, used by:
        https://github.com/MicroFocus/octane-intellij-plugin
        https://github.com/MicroFocus/octane-eclipse-plugin
    </description>
    <url>https://github.com/MicroFocus/octane-plugin-common</url>

    <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>

    <scm>
        <url>https://github.com/MicroFocus/octane-plugin-common</url>
        <connection>scm:git:https://github.com/MicroFocus/octane-plugin-common</connection>
        <developerConnection>scm:git:git@github.com:MicroFocus/octane-plugin-common.git</developerConnection>
    </scm>

    <organization>
        <name>Micro Focus</name>
        <url>https://www.microfocus.com/</url>
    </organization>

    <developers>
        <developer>
            <name>Alexandra Marinescu</name>
            <email>alexandra.marinescu@microfocus.com</email>
            <organization>Micro Focus</organization>
        </developer>
        <developer>
            <name>Andras Toth</name>
            <email>atoth@microfocus.com</email>
            <organization>Micro Focus</organization>
        </developer>
        <developer>
            <name>Octavian Savencu</name>
            <email>osavencu@microfocus.com</email>
            <organization>Micro Focus</organization>
        </developer>
        <developer>
            <name>Tudor Dulau</name>
            <email>dulau@microfocus.com</email>
            <organization>Micro Focus</organization>
        </developer>
        <developer>
            <name>Vlad Benchea</name>
            <email>vlad.benchea@microfocus.com</email>
            <organization>Micro Focus</organization>
        </developer>
        <developer>
            <name>Kadar Tibor</name>
            <email>kadar-tibor.manasse@microfocus.com</email>
            <organization>Micro Focus</organization>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <java.source.version>11</java.source.version>
        <java.target.version>11</java.target.version>
        <maven-compiler.version>3.6.1</maven-compiler.version>

        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-surefire.version>2.19.1</maven-surefire.version>
        <maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>

        <logback.version>1.2.3</logback.version>

        <runSuite>IntegrationTestSuite.class</runSuite>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.microfocus.adm.almoctane.sdk</groupId>
            <artifactId>sdk-src</artifactId>
            <version>16.0.400.1</version>
        </dependency>
        <dependency>
            <groupId>com.microfocus.adm.almoctane.sdk.extension</groupId>
            <artifactId>sdk-extension-src</artifactId>
            <version>16.0.400.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client-apache-v2</artifactId>
            <version>1.30.2</version>
        </dependency>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.15.3</version>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>5.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.7</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>

        <!-- Logging for tests-->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- License headers are checked during the verify phase, the build will fail if a file is missing the header. -->
            <!-- To fix license errors, use the following commands on the root pom. -->
            <!-- mvn com.mycila:license-maven-plugin:format (add headers if missing) -->
            <!-- mvn com.mycila:license-maven-plugin:remove (remove existing header) -->
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <!-- Update this file accordingly to change the license everywhere -->
                    <header>LICENSE</header>
                    <excludes>
                        <exclude>README.MD</exclude>
                        <exclude>.gitignore</exclude>
                        <exclude>LICENSE</exclude>
                        <exclude>**/**.html</exclude>
                        <exclude>**/**.vm</exclude>
                        <exclude>**/**.properties</exclude>
                        <exclude>**/src/test/resources/**</exclude>
                        <exclude>***/src/main/resources/**</exclude>
                    </excludes>
                    <mapping>
                        <!--Do not use javadoc comments for .java files, use only /* -->
                        <!--Not sure why that's the default.-->
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler.version}</version>
                <configuration>
                    <source>${java.source.version}</source>
                    <target>${java.target.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire.version}</version>
                <configuration>
                    <includes>
                        <include>${runSuite}</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>build-deployment</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                    <goal>test-jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>release-repository</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <repository>
                    <id>release-repository</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                </repository>
                <snapshotRepository>
                    <id>snapshot-repository</id>
                    <name>Maven2 Snapshot Repository</name>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>

        <profile>
            <id>release-internal</id>
            <distributionManagement>
                <repository>
                    <id>mqm-snapshots</id>
                    <name>Internal Nexus</name>
                    <url>${internal-nexus-url}</url>
                </repository>
            </distributionManagement>
        </profile>

    </profiles>

</project>