<?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>io.github.cstesttool</groupId>
  <artifactId>cstesting-java</artifactId>
  <version>0.1.6</version>
  <packaging>jar</packaging>
  <name>CSTesting Java Client</name>
  <description>Java client for CSTesting browser automation (connects to Node server).</description>
  <url>https://github.com/cstesttool/CSTesting-Java</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/licenses/MIT</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>cstesttool</id>
      <name>Gorantla Lokesh</name>
      <email>lokesh.ust@gmail.com</email>
      <url>https://github.com/cstesttool</url>
    </developer>
  </developers>

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

  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- false = sign artifacts (required for Maven Central). true = skip signing (default for local builds). -->
    <skipSigning>true</skipSigning>
  </properties>

  <profiles>
    <!-- Use: mvn clean deploy -Prelease -Dgpg.passphrase=YOUR_PASSPHRASE -->
    <profile>
      <id>release</id>
      <properties>
        <skipSigning>false</skipSigning>
      </properties>
    </profile>
    <!-- Run annotation tests: mvn exec:java -Pannotation-tests -->
    <profile>
      <id>annotation-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
              <execution>
                <id>run-annotation-tests</id>
                <phase>none</phase>
                <goals><goal>java</goal></goals>
                <configuration>
                  <mainClass>com.cstesting.runner.CSTestingRunner</mainClass>
                  <arguments>
                    <argument>com.cstesting.example.AnnotationTestExample</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>org.java-websocket</groupId>
      <artifactId>Java-WebSocket</artifactId>
      <version>1.5.4</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.10.1</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <failOnError>false</failOnError>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.6.3</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.9.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals><goal>sign</goal></goals>
            <configuration>
              <skip>${skipSigning}</skip>
              <keyname>66720976</keyname>
              <passphrase>${gpg.passphrase}</passphrase>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.1.1</version>
        <configuration>
          <mainClass>com.cstesting.example.OpenBrowserDemo</mainClass>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <scm>
    <connection>scm:git:git://github.com/cstesttool/CSTesting-Java.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/cstesttool/CSTesting-Java.git</developerConnection>
    <url>https://github.com/cstesttool/CSTesting-Java</url>
  </scm>
</project>
