<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.mulesoft.connectors</groupId>
    <artifactId>mule-connector-commons</artifactId>
    <version>1.1.0</version>
    <packaging>jar</packaging>
    <name>Common Connectors Library</name>
    <properties>
        <maven.enforcer.version>3.0.0-M1</maven.enforcer.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>atlantic-commons</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-api</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>

            <!-- Plugin added to enforce java version. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <!-- Plugin added to make sure that all dependencies that are declared are used. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <id>connector-analyze</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <ignoredDependencies>
                                <ignoredDependency>org.mule.*</ignoredDependency>
                            </ignoredDependencies>
                            <failOnWarning>true</failOnWarning>
                            <ignoredUsedUndeclaredDependencies>
                                <ignoredUsedUndeclaredDependency>*</ignoredUsedUndeclaredDependency>
                            </ignoredUsedUndeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Plugin added to fix issue in release plugin while using git. -->
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4.2</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.8.1</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Plugin added to enforce the compliance with several rules. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven.enforcer.version}</version>
                <executions>
                    <execution>
                        <id>default-enforced-rules</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDistributionManagement />
                                <requireNoRepositories>
                                    <allowedRepositories>
                                        <!-- This is a repository provided by this pom's parent. -->
                                        <allowedRepository>mule</allowedRepository>
                                    </allowedRepositories>
                                    <allowedPluginRepositories>
                                        <!-- These are repositories provided by this pom's parent. -->
                                        <allowedPluginRepository>mulesoft-plugin-releases</allowedPluginRepository>
                                        <allowedPluginRepository>mulesoft-plugin-snapshots</allowedPluginRepository>
                                    </allowedPluginRepositories>
                                </requireNoRepositories>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <scm>
        <connection>scm:git:git@github.com:mulesoft/mule-connector-commons.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/mule-connector-commons.git</developerConnection>
        <url>https://github.com/mulesoft/mule-connector-commons</url>
        <tag>mule-connector-commons-1.1.0</tag>
    </scm>
    <profiles>
        <profile>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <id>nexus-ci-releases-deployer</id>
            <distributionManagement>
                <repository>
                    <id>mule-ci-releases</id>
                    <name>Nexus CI Releases</name>
                    <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-releases/</url>
                </repository>
                <snapshotRepository>
                    <id>mule-ci-snapshots</id>
                    <name>Nexus CI Snapshots</name>
                    <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-snapshots/</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <id>nexus-releases-ee-deployer</id>
            <distributionManagement>
                <repository>
                    <id>mule-releases-ee</id>
                    <name>Nexus EE Releases</name>
                    <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${maven.enforcer.version}</version>
                        <executions>
                            <execution>
                                <id>version-enforced-rules</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseVersion />
                                        <requireReleaseDeps />
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <id>exchange-devx-deployer</id>
            <properties>
                <deployment.url>
                    https://maven.devx.anypoint.mulesoft.com/api/v1/organizations/${exchange.organization.id}/maven
                </deployment.url>
            </properties>
            <distributionManagement>
                <repository>
                    <id>exchange-devx</id>
                    <name>MuleSoft Exchange DevX Environment</name>
                    <url>${deployment.url}</url>
                </repository>
                <snapshotRepository>
                    <id>exchange-devx</id>
                    <name>MuleSoft Exchange DevX Environment</name>
                    <url>${deployment.url}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>exchange-qax-deployer</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <deployment.url>
                    https://maven.qax.anypoint.mulesoft.com/api/v1/organizations/${exchange.organization.id}/maven
                </deployment.url>
            </properties>
            <distributionManagement>
                <repository>
                    <id>exchange-qax</id>
                    <name>MuleSoft Exchange QAX Environment</name>
                    <url>${deployment.url}</url>
                </repository>
                <snapshotRepository>
                    <id>exchange-qax</id>
                    <name>MuleSoft Exchange QAX Environment</name>
                    <url>${deployment.url}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>exchange-stgx-deployer</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <deployment.url>
                    https://maven.stgx.anypoint.mulesoft.com/api/v1/organizations/${exchange.organization.id}/maven
                </deployment.url>
            </properties>
            <distributionManagement>
                <repository>
                    <id>exchange-stgx</id>
                    <name>MuleSoft Exchange StageX Environment</name>
                    <url>${deployment.url}</url>
                </repository>
                <snapshotRepository>
                    <id>exchange-stgx</id>
                    <name>MuleSoft Exchange StageX Environment</name>
                    <url>${deployment.url}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>exchange-stgxdr-deployer</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <deployment.url>
                    https://maven.stgxdr.anypoint.mulesoft.com/api/v1/organizations/${exchange.organization.id}/maven
                </deployment.url>
            </properties>
            <distributionManagement>
                <repository>
                    <id>exchange-stgxdr</id>
                    <name>MuleSoft Exchange StageX Disaster Recovery Environment</name>
                    <url>${deployment.url}</url>
                </repository>
                <snapshotRepository>
                    <id>exchange-stgxdr</id>
                    <name>MuleSoft Exchange StageX Disaster Recovery Environment</name>
                    <url>${deployment.url}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>exchange-prod-deployer</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <deployment.url>
                    https://maven.anypoint.mulesoft.com/api/v1/organizations/${exchange.organization.id}/maven
                </deployment.url>
            </properties>
            <distributionManagement>
                <repository>
                    <id>exchange</id>
                    <name>MuleSoft Exchange Productive Environment</name>
                    <url>${deployment.url}</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${maven.enforcer.version}</version>
                        <executions>
                            <execution>
                                <id>version-enforced-rules</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseVersion />
                                        <requireReleaseDeps />
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>exchange-prod-eu-deployer</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <deployment.url>
                    https://maven.eu1.anypoint.mulesoft.com/api/v1/organizations/${exchange.eu.organization.id}/maven
                </deployment.url>
            </properties>
            <distributionManagement>
                <repository>
                    <id>exchange-prod-eu</id>
                    <name>MuleSoft Exchange Productive Environment</name>
                    <url>${deployment.url}</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${maven.enforcer.version}</version>
                        <executions>
                            <execution>
                                <id>version-enforced-rules</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseVersion />
                                        <requireReleaseDeps />
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
