<?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.8.3</version>
	<packaging>mule-extension</packaging>
	<name>AMQP Connector</name>

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

	<properties>
		<formatterConfigPath>formatter.xml</formatterConfigPath>
		<jacoco.version>0.8.10</jacoco.version>
		<rabbitmq.amqp-client.version>5.25.0</rabbitmq.amqp-client.version>
		<java.module.version>1.2.14</java.module.version>
		<commonsLangVersion>3.17.0</commonsLangVersion>
		<commonsIoVersion>2.19.0</commonsIoVersion>
		<javaXmlBindVersion>2.3.1-MULE-001</javaXmlBindVersion>
		<powermockVersion>2.0.9</powermockVersion>
		<docker.maven.plugin.version>0.46.0</docker.maven.plugin.version>
		<groovy.version>3.0.19</groovy.version>
		<scripting.version>2.1.1</scripting.version>
		<apacheQpidBrokerVersion>8.0.6</apacheQpidBrokerVersion>
		<maven.helper.plugin.version>3.6.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.6.0</munit.extensions.maven.plugin.version>
		<munit.version>3.5.0</munit.version>
		<mtf.tools.version>1.2.0</mtf.tools.version>
		<muleSdkApiVersion>0.7.0</muleSdkApiVersion>
		<woodstox.core.version>5.4.0</woodstox.core.version>
		<jython.version>2.7.4</jython.version>
		<licenseYear>2021</licenseYear>
		<keystore.format>${keystore.type}</keystore.format>
		<mavenResourcesVersion>3.3.1</mavenResourcesVersion>
		<default.profile>true</default.profile>
		<mule-file-connector.version>1.5.3</mule-file-connector.version>
	</properties>

	<dependencies>

		<!-- W-14499064: Exclusión of org.json:json@20160810 due to security vulnerabilities-->
		<dependency>
			<groupId>org.mule.runtime</groupId>
			<artifactId>mule-metadata-model-json</artifactId>
			<version>${mule.metadata.version}</version>
			<scope>provided</scope>
			<exclusions>
				<exclusion>
					<groupId>org.json</groupId>
					<artifactId>json</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- W-14499064: Mule Weave Service with exclusión de woodstox-core:5.3.0 -->
		<dependency>
			<groupId>org.mule.services</groupId>
			<artifactId>mule-service-weave</artifactId>
			<version>${mule.weave.version}</version>
			<scope>provided</scope>
			<exclusions>
				<exclusion>
					<groupId>com.fasterxml.woodstox</groupId>
					<artifactId>woodstox-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.woodstox</groupId>
			<artifactId>woodstox-core</artifactId>
			<version>${woodstox.core.version}</version>
			<scope>provided</scope>
		</dependency>

		<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>
		<dependency>
			<groupId>org.python</groupId>
			<artifactId>jython-standalone</artifactId>
			<version>${jython.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>${mavenResourcesVersion}</version>
				<executions>
					<execution>
						<id>copy-munit-resources</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/test-mule/munit</outputDirectory>
							<resources>
								<resource>
									<directory>src/test/munit</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<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.python</groupId>
							<artifactId>jython-standalone</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.python</groupId>
						<artifactId>jython-standalone</artifactId>
						<version>${jython.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>
					<dependency>
						<groupId>org.mule.connectors</groupId>
						<artifactId>mule-file-connector</artifactId>
						<version>${mule-file-connector.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>
			<id>docker</id>
			<activation>
				<property>
					<name>java.version</name> <!-- always-active -->
				</property>
			</activation>
			<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-${rabbitmq.port}</alias>
									<build>
										<dockerFileDir>${project.basedir}/src/test/docker/vanilla</dockerFileDir>
									</build>
									<run>
										<containerNamePattern>%a-%t</containerNamePattern>
										<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-${rabbitmq.tls.port}</alias>
									<build>
										<dockerFileDir>${project.basedir}/src/test/docker/mtls</dockerFileDir>
									</build>
									<run>
										<containerNamePattern>%a-%t</containerNamePattern>
										<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>2.0.6</version>
							</dependency>
							<dependency>
								<groupId>org.slf4j</groupId>
								<artifactId>jcl-over-slf4j</artifactId>
								<version>2.0.6</version>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<id>start</id>
								<phase>test</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>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>${jacoco.version}</version>
						<executions>
							<execution>
								<id>default-prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
							<execution>
								<id>default-report</id>
								<goals>
									<goal>report</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>default-config</id>
			<activation>
				<property>
					<name>!mule.security.model</name> <!-- if mule.security.model does not exist -->
				</property>
			</activation>
			<properties>
				<keystore.type>jks</keystore.type>
			</properties>
		</profile>
		<profile>
			<id>fips-config</id>
			<activation>
				<property>
					<name>mule.security.model</name>
					<value>fips140-2</value> <!-- if mule.security.model == fips140-2 -->
				</property>
			</activation>
			<properties>
				<keystore.type>bcfks</keystore.type>
			</properties>
		</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>
