<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>com.mulesoft.connectors</groupId>
	<artifactId>mule-amqp-connector</artifactId>
	<version>1.7.7</version>
	<packaging>mule-extension</packaging>
	<name>AMQP Connector</name>

	<parent>
		<groupId>org.mule.extensions</groupId>
		<artifactId>mule-ee-core-modules-parent</artifactId>
		<version>1.1.9</version>
	</parent>

	<properties>
		<formatterConfigPath>formatter.xml</formatterConfigPath>
		<rabbitmq.amqp-client.version>5.18.0</rabbitmq.amqp-client.version>
		<jacoco.version>0.8.10</jacoco.version>
		<java.module.version>1.2.12</java.module.version>
		<commonsLangVersion>3.12.0</commonsLangVersion>
		<commonsIoVersion>2.11.0</commonsIoVersion>
		<javaXmlBindVersion>2.3.1-MULE-001</javaXmlBindVersion>
		<powermockVersion>2.0.9</powermockVersion>
		<docker.maven.plugin.version>0.40.2</docker.maven.plugin.version>
		<groovy.version>3.0.19</groovy.version>
		<scripting.version>2.1.0</scripting.version>
		<apacheQpidBrokerVersion>8.0.6</apacheQpidBrokerVersion>
		<maven.helper.plugin.version>3.3.0</maven.helper.plugin.version>
		<munit.input.directory>src/test/munit</munit.input.directory>
		<munit.output.directory>${basedir}/target/test-mule/munit</munit.output.directory>
		<munit.extensions.maven.plugin.version>1.2.0-rc2</munit.extensions.maven.plugin.version>
		<munit.version>3.1.0-rc3</munit.version>
		<mtf.tools.version>1.2.0-rc1</mtf.tools.version>
		<muleSdkApiVersion>0.7.0</muleSdkApiVersion>
		<licenseYear>2021</licenseYear>
	</properties>

	<dependencies>
		<!-- Transport dependencies -->
		<dependency>
			<groupId>com.rabbitmq</groupId>
			<artifactId>amqp-client</artifactId>
			<version>${rabbitmq.amqp-client.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commonsIoVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>${commonsLangVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.mule.sdk</groupId>
			<artifactId>mule-sdk-api</artifactId>
			<version>${muleSdkApiVersion}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.qpid</groupId>
			<artifactId>qpid-broker-core</artifactId>
			<version>${apacheQpidBrokerVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.qpid</groupId>
			<artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
			<version>${apacheQpidBrokerVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.qpid</groupId>
			<artifactId>qpid-broker-plugins-memory-store</artifactId>
			<version>${apacheQpidBrokerVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mule.glassfish.jaxb</groupId>
			<artifactId>jaxb-runtime</artifactId>
			<version>${javaXmlBindVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-core</artifactId>
			<version>${powermockVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-api-mockito2</artifactId>
			<version>${powermockVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-module-junit4</artifactId>
			<version>${powermockVersion}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>${maven.helper.plugin.version}</version>
				<executions>
					<execution>
						<id>reserve-network-port</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>reserve-network-port</goal>
						</goals>
						<configuration>
							<portNames>
								<portName>rabbitmq.port</portName>
								<portName>rabbitmq.tls.port</portName>
							</portNames>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<systemPropertyVariables>
						<amqpVirtualHost>/</amqpVirtualHost>
						<amqpUserName>guest</amqpUserName>
						<amqpPassword>guest</amqpPassword>
						<amqpHost>127.0.0.1</amqpHost>
						<amqpPort>5672</amqpPort>
						<amqpSslPort>5671</amqpSslPort>
						<amqpSslProtocol>${amqpSslProtocolByJdk}</amqpSslProtocol>
						<QPID_WORK>${build.directory}/work</QPID_WORK>
						<mule.disable.nio.connection>${mule.disable.nio.connection}</mule.disable.nio.connection>
					</systemPropertyVariables>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.mulesoft.munit</groupId>
				<artifactId>munit-extensions-maven-plugin</artifactId>
				<version>${munit.extensions.maven.plugin.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>integration-test</phase>
					</execution>
				</executions>
				<configuration>
					<argLines>
						<argLine>
							-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${session.executionRootDirectory}/target/jacoco.exec
						</argLine>
					</argLines>
					<runtimeConfiguration>
						<discoverRuntimes>
							<minMuleVersion>${minVersion}</minMuleVersion>
							<includeSnapshots>false</includeSnapshots>
							<product>EE</product>
						</discoverRuntimes>
					</runtimeConfiguration>
					<sharedLibraries>
						<sharedLibrary>
							<groupId>org.codehaus.groovy</groupId>
							<artifactId>groovy</artifactId>
						</sharedLibrary>
						<sharedLibrary>
							<groupId>org.codehaus.groovy</groupId>
							<artifactId>groovy-jsr223</artifactId>
						</sharedLibrary>
					</sharedLibraries>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>com.mulesoft.munit</groupId>
						<artifactId>munit-runner</artifactId>
						<version>${munit.version}</version>
						<classifier>mule-plugin</classifier>
					</dependency>
					<dependency>
						<groupId>com.mulesoft.munit</groupId>
						<artifactId>munit-tools</artifactId>
						<version>${munit.version}</version>
						<classifier>mule-plugin</classifier>
					</dependency>
					<dependency>
						<groupId>com.mulesoft.munit</groupId>
						<artifactId>mtf-tools</artifactId>
						<version>${mtf.tools.version}</version>
						<classifier>mule-plugin</classifier>
					</dependency>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy</artifactId>
						<version>${groovy.version}</version>
					</dependency>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-jsr223</artifactId>
						<version>${groovy.version}</version>
					</dependency>
					<dependency>
						<groupId>org.mule.modules</groupId>
						<artifactId>mule-scripting-module</artifactId>
						<version>${scripting.version}</version>
						<classifier>mule-plugin</classifier>
					</dependency>
					<dependency>
						<groupId>org.mule.module</groupId>
						<artifactId>mule-java-module</artifactId>
						<version>${java.module.version}</version>
						<classifier>mule-plugin</classifier>
					</dependency>
				</dependencies>
			</plugin>

		</plugins>
	</build>

	<profiles>
		<profile>
			<properties>
				<mule.disable.nio.connection>false</mule.disable.nio.connection>
			</properties>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<id>nio</id>
		</profile>
		<profile>
			<properties>
				<mule.disable.nio.connection>true</mule.disable.nio.connection>
			</properties>
			<id>blocking</id>
		</profile>
	<profile>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<id>docker</id>
		<build>
			<plugins>
				<plugin>
					<groupId>io.fabric8</groupId>
					<artifactId>docker-maven-plugin</artifactId>
					<version>${docker.maven.plugin.version}</version>
					<configuration>
						<images>
							<image>
								<name>mule-amqp-vanilla</name>
								<alias>mule-amqp-vanilla</alias>
								<build>
									<dockerFileDir>${project.basedir}/src/test/docker/vanilla</dockerFileDir>
								</build>
								<run>
									<ports>
										<port>rabbitmq.port:5672</port>
									</ports>
									<ulimits>
										<ulimit>
											<name>nofile</name>
											<hard>10240</hard>
											<soft>10240</soft>
										</ulimit>
									</ulimits>
									<log>
										<enabled>true</enabled>
									</log>
									<wait>
										<log>Server startup complete</log>
										<time>500000</time>
										<kill>1000</kill>
										<shutdown>500</shutdown>
									</wait>
								</run>
							</image>
							<image>
								<name>mule-amqp-mtls</name>
								<alias>mule-amqp-mtls</alias>
								<build>
									<dockerFileDir>${project.basedir}/src/test/docker/mtls</dockerFileDir>
								</build>
								<run>
									<ports>
										<port>rabbitmq.tls.port:5671</port>
									</ports>
									<ulimits>
										<ulimit>
											<name>nofile</name>
											<hard>10240</hard>
											<soft>10240</soft>
										</ulimit>
									</ulimits>
									<log>
										<enabled>true</enabled>
									</log>
									<wait>
										<log>Server startup complete</log>
										<time>500000</time>
										<kill>1000</kill>
										<shutdown>500</shutdown>
									</wait>
								</run>
							</image>
						</images>
						<verbose>true</verbose>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>org.slf4j</groupId>
							<artifactId>slf4j-api</artifactId>
							<version>1.7.36</version>
						</dependency>
						<dependency>
							<groupId>org.slf4j</groupId>
							<artifactId>jcl-over-slf4j</artifactId>
							<version>1.7.36</version>
						</dependency>
					</dependencies>
					<executions>
						<execution>
							<id>start</id>
							<phase>test-compile</phase>
							<goals>
								<goal>build</goal>
								<goal>start</goal>
							</goals>
							<configuration>
								<showLogs>true</showLogs>
								<logStdout>true</logStdout>
							</configuration>
						</execution>
						<execution>
							<id>stop</id>
							<phase>post-integration-test</phase>
							<goals>
								<goal>stop</goal>
								<goal>remove</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>
	</profiles>


	<repositories>
		<repository>
			<id>mulesoft-private</id>
			<name>Mulesoft internal repository</name>
			<url>https://repository.mulesoft.org/nexus/content/repositories/private/</url>
		</repository>
		<repository>
			<id>mule</id>
			<name>Mule Repository</name>
			<url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>mulesoft-private</id>
			<name>Mulesoft internal repository</name>
			<url>https://repository.mulesoft.org/nexus/content/repositories/private/</url>
		</pluginRepository>
	</pluginRepositories>
</project>

