<?xml version="1.0" encoding="UTF-8"?>
<!--
# Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
#
# 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>org.wso2.integration.transaction.counter</groupId>
  <version>1.2.0</version>
  <artifactId>transaction-count-handler</artifactId>
  <packaging>bundle</packaging>
  <name>WSO2 Integration Transaction Counting Handler</name>

  <dependencies>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>${commons-logging.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.synapse</groupId>
      <artifactId>synapse-core</artifactId>
      <version>${synapse.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>${google.code.gson.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents.wso2</groupId>
      <artifactId>httpcore</artifactId>
      <version>${httpcore.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents.wso2</groupId>
      <artifactId>httpclient</artifactId>
      <version>${httpcomponent.version}</version>
    </dependency>
  </dependencies>

  <scm>
    <connection>scm:git:https://github.com/wso2/integration-transaction-counter.git</connection>
    <developerConnection>scm:git:https://github.com/wso2/integration-transaction-counter.git</developerConnection>
    <url>https://github.com/wso2/integration-transaction-counter.git/</url>
    <tag>HEAD</tag>
  </scm>

  <profiles>
    <profile>
      <id>deploy</id>
    </profile>
  </profiles>

  <repositories>
    <repository>
      <id>wso2-nexus</id>
      <name>WSO2 internal Repository</name>
      <url>https://maven.wso2.org/nexus/content/groups/wso2-public/</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
    </repository>
    <repository>
      <id>wso2.releases</id>
      <name>WSO2 internal Repository</name>
      <url>https://maven.wso2.org/nexus/content/repositories/releases/</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
      <id>wso2.releases</id>
      <name>WSO2 Releases Repository</name>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <url>https://maven.wso2.org/nexus/content/repositories/releases/</url>
      <layout>default</layout>
    </repository>
  </distributionManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${bundle.plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${project.groupId}</Bundle-SymbolicName>
            <Bundle-Name>${project.artifactId}</Bundle-Name>
            <Bundle-Version>${project.version}</Bundle-Version>
            <Export-Package>
              org.wso2.integration.transaction.counter.*,
            </Export-Package>
            <Import-Package>
              org.apache.synapse.core, *;resolution:=optional
            </Import-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler.plugin.version}</version>
        <configuration>
          <source>8</source>
          <target>8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <preparationGoals>clean install</preparationGoals>
          <autoVersionSubmodules>true</autoVersionSubmodules>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.4</version>
        <executions>
          <execution>
            <id>default-prepare-agent-by-coverage-enforcer</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <propertyName>argLine</propertyName>
            </configuration>
          </execution>
          <execution>
            <id>default-report-by-coverage-enforcer</id>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>${project.build.directory}/jacoco.exec</dataFile>
            </configuration>
          </execution>
          <execution>
            <id>default-check-by-coverage-enforcer</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <dataFile>${project.build.directory}/jacoco.exec</dataFile>
              <rules>
                <!-- implementation is needed only for Maven 2 -->
                <rule implementation="org.jacoco.maven.RuleConfiguration">
                  <element>BUNDLE</element>
                  <limits>
                    <!-- implementation is needed only for Maven 2 -->
                    <limit implementation="org.jacoco.report.check.Limit">
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.0</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
        <configuration>
          <argLine>${argLine}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>
    </plugins>
  </build>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <commons-logging.version>1.1.1</commons-logging.version>
    <synapse.version>[4.0.0,5.0.0)</synapse.version>
    <google.code.gson.version>2.9.1</google.code.gson.version>
    <httpcore.version>4.4.16.wso2v1</httpcore.version>
    <httpcomponent.version>4.2.5.wso2v1</httpcomponent.version>
    <compiler.plugin.version>3.11.0</compiler.plugin.version>
    <bundle.plugin.version>5.1.2</bundle.plugin.version>
  </properties>
</project>
