<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
 *  Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
 *
 *  WSO2 LLC. licenses this file to you 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.inbound</groupId>
    <artifactId>mi-inbound-rabbitmq</artifactId>
    <version>1.0.1</version>
    <name>mi-inbound-rabbitmq</name>
    <url>http://wso2.org</url>
    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <skip-tests>true</skip-tests>
        <maven.surfire.version>2.19.1</maven.surfire.version>
        <maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
        <rabbitmq.client.version>0.7.0</rabbitmq.client.version>
        <inbound.endpoint.version>4.5.0</inbound.endpoint.version>
        <io.netty.version>4.2.6.Final</io.netty.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.wso2.ei</groupId>
            <artifactId>org.wso2.micro.integrator.inbound.endpoint</artifactId>
            <version>${inbound.endpoint.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.ei</groupId>
            <artifactId>org.wso2.micro.integrator.ntask.core</artifactId>
            <version>${inbound.endpoint.version}</version>
        </dependency>
        <dependency>
            <groupId>com.rabbitmq.client</groupId>
            <artifactId>amqp-client</artifactId>
            <version>${rabbitmq.client.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-buffer</artifactId>
            <version>${io.netty.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport</artifactId>
            <version>${io.netty.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-resolver</artifactId>
            <version>${io.netty.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
            <version>${io.netty.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-common</artifactId>
            <version>${io.netty.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-base</artifactId>
            <version>${io.netty.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-unix-common</artifactId>
            <version>${io.netty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2.wso2</groupId>
            <artifactId>axis2</artifactId>
        <version>1.6.1-wso2v110</version>
    </dependency>
    </dependencies>
     <scm>
        <connection>scm:git:https://github.com/wso2-extensions/mi-inbound-rabbitmq.git
        </connection>
        <url>https://github.com/wso2-extensions/mi-inbound-rabbitmq.git</url>
        <developerConnection>scm:git:https://github.com/wso2-extensions/mi-inbound-rabbitmq
        </developerConnection>
        <tag>v1.0.1</tag>
    </scm>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <filters>
                        <filter>${basedir}/src/main/assembly/filter.properties</filter>
                    </filters>
                    <descriptors>
                        <descriptor>src/main/assembly/zip-assembly.xml</descriptor>
                    </descriptors>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven-shade-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <outputFile>${project.build.directory}/${project.build.finalName}.jar</outputFile>
                            <artifactSet>
                                <includes>
                                    <include>com.rabbitmq.client:amqp-client</include>
                                    <include>io.netty:netty-common</include>
                                    <include>io.netty:netty-buffer</include>
                                    <include>io.netty:netty-transport</include>
                                    <include>io.netty:netty-resolver</include>
                                    <include>io.netty:netty-handler</include>
                                    <include>io.netty:netty-codec-base</include>
                                    <include>io.netty:netty-transport-native-unix-common</include>
                                </includes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                            </transformers>
                            <relocations>
                                <relocation>
                                    <pattern>io.netty</pattern>
                                    <shadedPattern>io.netty.wso2.shaded</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surfire.version}</version>
                <configuration>
                    <skipTests>${skip-tests}</skipTests>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>wso2-nexus</id>
            <name>WSO2 Nexus 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>
    </repositories>
    <distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>WSO2 Release Distribution Repository</name>
            <url>https://maven.wso2.org/nexus/content/repositories/releases/</url>
        </repository>
    </distributionManagement>

</project>
