<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.blazemeter</groupId>
  <artifactId>jmeter-bzm-rte</artifactId>
  <packaging>jar</packaging>
  <version>3.2.2</version>
  <name>RTEPlugin Sampler as JMeter plugin</name>
  <description>JMeter plugin to support RTE (Remote Terminal Emulation) protocols</description>
  <url>https://github.com/Blazemeter/RTEPlugin</url>

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

  <developers>
    <developer>
      <name>Blazemeter</name>
      <email>ops@blazemeter.com</email>
      <organization>Blazemeter</organization>
      <organizationUrl>https://blazemeter.com/</organizationUrl>
    </developer>
  </developers>

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

    <jmeter.version>3.2</jmeter.version>
  </properties>

  <repositories>
    <repository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
    </repository>
  </repositories>

  <scm>
    <connection>scm:git:git@gitlab.abstracta.us:BZ-plugins/jmeter-rte-plugin.git</connection>
    <developerConnection>scm:git:git@gitlab.abstracta.us:BZ-plugins/jmeter-rte-plugin.git
    </developerConnection>
    <url>http://gitlab.abstracta.us/BZ-plugins/jmeter-rte-plugin</url>
  </scm>

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

  <dependencies>
  
    <dependency>
      <groupId>com.github.blazemeter</groupId>
      <artifactId>xtn5250</artifactId>
      <version>3.2.4</version>
    </dependency>
    <dependency>
      <groupId>com.github.blazemeter</groupId>
      <artifactId>dm3270</artifactId>
      <version>0.15-lib</version>
    </dependency>
    <dependency>
      <groupId>com.github.blazemeter</groupId>
      <artifactId>jVT220</artifactId>
      <version>jvt220-v1.3.2</version>
    </dependency>

    <dependency>
      <groupId>org.apache.jmeter</groupId>
      <artifactId>ApacheJMeter_core</artifactId>
      <version>${jmeter.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-net</artifactId>
          <groupId>commons-net</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.jmeter</groupId>
      <artifactId>ApacheJMeter_http</artifactId>
      <version>${jmeter.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-net</artifactId>
          <groupId>commons-net</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.26</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>kg.apc</groupId>
      <artifactId>jmeter-plugins-cmn-jmeter</artifactId>
      <scope>test</scope>
      <version>0.6</version>
    </dependency>
    <dependency>
      <groupId>kg.apc</groupId>
      <artifactId>jmeter-plugins-emulators</artifactId>
      <version>0.4</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>ApacheJMeter_tcp</artifactId>
          <groupId>org.apache.jmeter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>us.abstracta</groupId>
      <artifactId>wiresham</artifactId>
      <version>0.4.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>28.0-jre</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.12.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.28.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-swing</artifactId>
      <version>3.9.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-assertj</artifactId>
      <version>2.6.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <!-- avoid issue with jdk 11 -->
            <useSystemClassLoader>false</useSystemClassLoader>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <configuration>
              <configLocation>checkstyle.xml</configLocation>
              <failsOnError>true</failsOnError>
              <consoleOutput>true</consoleOutput>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>copy-jmeter-resources</id>
            <phase>install</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/jmeter-test</outputDirectory>
              <resources>
                <resource>
                  <directory>src/test/resources/jmeter</directory>
                  <filtering>true</filtering>
                </resource>
                <resource>
                  <directory>src/test/resources/com/blazemeter/jmeter/rte/protocols</directory>
                  <includes>
                    <include>tn3270/login.yml</include>
                    <include>tn5250/login.yml</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>copy-jmeter-dependencies</id>
            <phase>install</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <includeArtifactIds>
                wiresham,guava,snakeyaml,jackson-databind,jackson-core,jackson-annotations,xtn5250,dm3270,pcap4j-core,jVT220
              </includeArtifactIds>
              <outputDirectory>${project.build.directory}/jmeter-test/lib</outputDirectory>
              <stripVersion>true</stripVersion>
            </configuration>
          </execution>
          <execution>
            <id>copy-plugin-to-jmeter-dependencies</id>
            <phase>install</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <type>${project.packaging}</type>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/jmeter-test/lib</outputDirectory>
              <stripVersion>true</stripVersion>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>sonar</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.sonarsource.scanner.maven</groupId>
              <artifactId>sonar-maven-plugin</artifactId>
              <version>3.6.0.1398</version>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.4</version>
            <configuration>
              <append>true</append>
            </configuration>
            <executions>
              <execution>
                <id>agent-for-ut</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <propertyName>jacoco.agent.ut.arg</propertyName>
                </configuration>
              </execution>
              <execution>
                <id>agent-for-it</id>
                <goals>
                  <goal>prepare-agent-integration</goal>
                </goals>
                <configuration>
                  <propertyName>jacoco.agent.it.arg</propertyName>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <!--suppress MavenModelInspection -->
              <argLine>${jacoco.agent.ut.arg}</argLine>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <!--suppress MavenModelInspection -->
              <argLine>${jacoco.agent.it.arg}</argLine>
              <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build> 
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</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.0.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </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://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
