<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>

    <parent>
        <groupId>com.mulesoft.mule.runtime</groupId>
        <artifactId>mule</artifactId>
        <version>4.7.2</version>
    </parent>

    <groupId>com.mulesoft.anypoint</groupId>
    <artifactId>api-gateway-parent</artifactId>
    <version>4.7.2</version>

    <packaging>pom</packaging>

    <!-- Organization -->
    <organization>
        <name>MuleSoft, Inc.</name>
        <url>http://www.mulesoft.com</url>
    </organization>

    <!-- Project -->
    <name>API Gateway Parent</name>
    <url>http://www.mulesoft.com</url>
    <inceptionYear>2014</inceptionYear>

    <licenses>
        <license>
            <name>MSA</name>
            <url>http://www.mulesoft.com/</url>
        </license>
    </licenses>

    <!-- Build -->
    <scm>
        <connection>scm:git:git://github.com/mulesoft/api-gateway.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/api-gateway.git</developerConnection>
        <url>http://github.com/mulesoft/api-gateway</url>
    </scm>

    <properties>
        <currentYear>2020</currentYear>
        <apacheHttpClientVersion>4.5.13</apacheHttpClientVersion>
        <apiGatewayVersion>4.7.2</apiGatewayVersion>
        <apiGatewayApiVersion>1.7.2</apiGatewayApiVersion>
        <apiGatewayTitaVersion>4.13.0</apiGatewayTitaVersion>
        <contractsServiceVersion>1.4.0</contractsServiceVersion>
        <contractsServiceApiVersion>1.5.0</contractsServiceApiVersion>
        <apiGatewayEventsCollectors>1.4.0</apiGatewayEventsCollectors>
        <apiGatewayEventsCollectorsApi>1.3.0</apiGatewayEventsCollectorsApi>
        <muleVersion>4.7.2</muleVersion>
        <muleHttpConnectorVersion>1.5.17</muleHttpConnectorVersion>
        <muleSocketsConnectorVersion>1.1.1</muleSocketsConnectorVersion>
        <mule.maven.plugin.version>4.2.0</mule.maven.plugin.version>
        <httpclientVersion>${apacheHttpClientVersion}</httpclientVersion>
        <apacheHttpFluentVersion>${httpclientVersion}</apacheHttpFluentVersion>
        <jackson2Version>2.15.0</jackson2Version>
        <mapdbVersion>1.0.6</mapdbVersion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.surefire.version>${maven.surefire.plugin.version}</maven.surefire.version>
        <slf4jTestVersion>2.6.1</slf4jTestVersion>

        <mulesoftLicenseVersion>1.1.0</mulesoftLicenseVersion>
        <license.maven.plugin.version>4.2</license.maven.plugin.version>
        <licensePath>LICENSE_HEADER_80.txt</licensePath>
        <licenseYear>2023</licenseYear>

        <argLine /> <!-- empty argLine, needed by surefire for when @{argLine} is not set -->
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <!--
                    The bulk of the config of the jar plugin is inherited from the parent
                    POM. We need to override the license, however ...
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Description>API Gateway Platform</Description>
                                <License>MSA v1.0 http://www.mulesoft.com/</License>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license.maven.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.mulesoft.license</groupId>
                        <artifactId>license</artifactId>
                        <version>${mulesoftLicenseVersion}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <header>${licensePath}</header>
                    <properties>
                        <year>${licenseYear}</year>
                    </properties>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <dependencies>
                    <!--Setting this surefire dependency forces all tests to run ONLY with JUnit.-->
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${maven.surefire.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <argLine>@{argLine} -Dfile.encoding=UTF-8</argLine>
                    <reuseForks>true</reuseForks>
                </configuration>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav</artifactId>
                <version>1.0-beta-2</version>
            </extension>
        </extensions>
    </build>

    <profiles>
        <profile>
            <id>nexus-ee</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <distributionManagement>
                <repository>
                    <id>mule-ee-customer-releases</id>
                    <name>Mule Release Repository</name>
                    <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>release</id>
            <properties>
                <skipNoSnapshotsEnforcerPluginRule>false</skipNoSnapshotsEnforcerPluginRule>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>1.4.1</version>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots-in-deps</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>No Snapshots Allowed in Deps!</message>
                                        </requireReleaseDeps>
                                        <requireReleaseVersion>
                                            <message>No Snapshots Allowed in Project Version!</message>
                                        </requireReleaseVersion>
                                        <requirePluginVersions>
                                            <message>Best Practice is to always define plugin versions!</message>
                                            <unCheckedPluginList>
                                                org.mule.tools.maven:exchange-mule-maven-plugin,
                                                org.apache.maven.plugins:maven-clean-plugin
                                            </unCheckedPluginList>
                                        </requirePluginVersions>
                                    </rules>
                                    <skip>${skipNoSnapshotsEnforcerPluginRule}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release-dry-run</id>
            <properties>
                <skipNoSnapshotsEnforcerPluginRule>false</skipNoSnapshotsEnforcerPluginRule>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${maven.enforcer.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots-in-deps</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>No Snapshots Allowed in Deps!</message>
                                            <excludes>
                                                <exclude>org.mule.weave:*</exclude>
                                                <exclude>com.mulesoft.services:mule-service-weave-ee</exclude>
                                                <exclude>org.mule.runtime:mule-dwb-api</exclude>
                                                <exclude>org.mule.services:*</exclude>
                                                <exclude>org.mule.tools.maven:mule-classloader-model</exclude>

                                                <exclude>com.mulesoft.anypoint:api-gateway-tita-unit</exclude>
                                                <exclude>com.mulesoft.anypoint.tita:test-dependencies</exclude>
                                                <exclude>com.mulesoft.anypoint:api-gateway-tita-environment-api</exclude>
                                            </excludes>
                                        </requireReleaseDeps>
                                    </rules>
                                    <skip>${skipNoSnapshotsEnforcerPluginRule}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <downloadUrl>http://www.mulesoft.com/mule-esb-enterprise-trial-download</downloadUrl>
        <repository>
            <id>mule-ee-releases</id>
            <name>Mule Release Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-releases</url>
        </repository>
        <snapshotRepository>
            <id>mule-ee-snapshots</id>
            <name>Mule Snapshot Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>mule-ci-releases</id>
            <name>Internal Release Repo</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>mule-ci-snapshots</id>
            <name>MuleEE Snapshots Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <repositories>
        <!--
            This repository definition is redundant as it's already present in the
            parent pom.

            However, when building the Enterprise modules with an empty local repository
            for the first time, the build *has* to know where to get its parent from and
            there's no way around this repo definition.
        -->
        <repository>
            <id>mule-ee-releases</id>
            <name>Internal Release Repo</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/ci-releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>mule-ee-snapshots</id>
            <name>Internal Release Repo</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/ci-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>libs-releases</id>
            <name>External libs</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/libs-releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>https://repository.mulesoft.org/releases/</url>
        </repository>
        <repository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshots Repository</name>
            <url>https://repository.mulesoft.org/snapshots/</url>
        </repository>
    </repositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclientVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>${mockitoVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-core-asl</artifactId>
                <version>${jacksonVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-mapper-asl</artifactId>
                <version>${jacksonVersion}</version>
            </dependency>
            <dependency>
                <groupId>com.github.valfirst</groupId>
                <artifactId>slf4j-test</artifactId>
                <version>${slf4jTestVersion}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
