<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>name.neykov</groupId>
  <artifactId>extract-tls-secrets</artifactId>
  <name>Extract TLS Master Secret</name>
  <version>5.0.0</version>
  <description>Decrypt HTTPS/TLS connections on-the-fly with Wireshark.

    Extracts the shared master key used in secure connections (SSL &amp; TLS)
    for use with Wireshark. Works with connections established with the
    (Java provided) javax.net.ssl.SSLSocket API.</description>
  <url>https://github.com/neykov/extract-tls-secrets</url>
  <developers>
    <developer>
      <name>Svetoslav Neykov</name>
      <email>svetoslav@neykov.name</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:https://github.com/neykov/extract-tls-secrets.git</connection>
    <developerConnection>scm:git:ssh://github.com:neykov/extract-tls-secrets.git</developerConnection>
    <url>http://github.com/neykov/extract-tls-secrets</url>
  </scm>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.15.0</version>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Main-Class>name.neykov.secrets.cli.AgentAttach</Main-Class>
              <Premain-Class>name.neykov.secrets.agent.AgentMain</Premain-Class>
              <Agent-Class>name.neykov.secrets.agent.AgentMain</Agent-Class>
              <Can-Redefine-Classes>true</Can-Redefine-Classes>
              <Can-Retransform-Classes>true</Can-Retransform-Classes>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <pattern>javassist</pattern>
                  <shadedPattern>name.neykov.secrets.internal.javassist</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>clean-test-lib</id>
            <phase>initialize</phase>
            <goals>
              <goal>clean</goal>
            </goals>
            <configuration>
              <excludeDefaultDirectories>true</excludeDefaultDirectories>
              <filesets>
                <fileset>
                  <directory>${project.build.directory}/test-lib</directory>
                </fileset>
              </filesets>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.8.0</version>
        <executions>
          <execution>
            <id>copy-test-deps</id>
            <phase>test-compile</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <includeGroupIds>org.bouncycastle</includeGroupIds>
              <outputDirectory>${project.build.directory}/test-lib</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <id>run-test-script</id>
            <phase>integration-test</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>src/test/docker/test.sh</executable>
              <arguments>
                <argument>attach</argument>
                <argument>target/${project.artifactId}-${project.version}.jar</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>run-clean-script</id>
            <phase>clean</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>src/test/docker/clean.sh</executable>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>2.43.0</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <java>
            <googleJavaFormat>
              <version>1.22.0</version>
              <style>AOSP</style>
            </googleJavaFormat>
          </java>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>Release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.11.2</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</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>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bctls-jdk15to18</artifactId>
      <version>1.73</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>bcutil-jdk15to18</artifactId>
          <groupId>org.bouncycastle</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk15to18</artifactId>
      <version>1.73</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <properties>
    <maven.compiler.target>1.6</maven.compiler.target>
    <maven.compiler.source>1.6</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>
