<?xml version="1.0" encoding="utf-8"?>
<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>

    <parent>
        <groupId>org.mule</groupId>
        <artifactId>mule-plugin-mgmt-parent-pom</artifactId>
        <version>4.11.1</version>
        <relativePath/>
    </parent>

    <groupId>org.mule.runtime</groupId>
    <artifactId>mule-metadata-model-parent</artifactId>
    <version>1.11.1</version>
    <packaging>pom</packaging>
    <name>Mule Metadata Model API</name>
    <description>Metadata Model to power Mule Runtime</description>
    <url>https://github.com/mulesoft/metadata-model-api</url>

    <organization>
        <name>MuleSoft, Inc.</name>
        <url>http://www.mulesoft.com</url>
    </organization>
    <licenses>
        <license>
            <name>CPAL v1.0</name>
            <url>http://www.mulesoft.com/CPAL</url>
        </license>
    </licenses>
    <mailingLists>
        <mailingList>
            <name>developers</name>
            <post>mule-esb@mulesoft.com</post>
        </mailingList>
    </mailingLists>

    <developers>
        <developer>
            <id>canoasan</id>
            <name>Matias Baldini</name>
            <email>matias.baldini@mulesoft.com</email>
            <roles>
                <role>Project Manager</role>
            </roles>
        </developer>
        <developer>
            <id>machaval</id>
            <name>Mariano Achaval</name>
        </developer>
        <developer>
            <id>dfeist</id>
            <name>Daniel Feist</name>
        </developer>
        <developer>
            <id>afelisatti</id>
            <name>Ana Felisatti</name>
        </developer>
        <developer>
            <id>LucianoGandini</id>
            <name>Luciano Gandini</name>
        </developer>
        <developer>
            <id>marianogonzalez</id>
            <name>Mariano Gonzalez</name>
        </developer>
        <developer>
            <id>aiannucci</id>
            <name>Alejandro Iannucci</name>
        </developer>
        <developer>
            <id>pablokraan</id>
            <name>Pablo Kraan</name>
        </developer>
        <developer>
            <id>pablolagreca</id>
            <name>Pablo La Greca</name>
        </developer>
        <developer>
            <id>anosenzo</id>
            <name>Alejandro Nosenzo</name>
        </developer>
        <developer>
            <id>asequeira</id>
            <name>Alejandro Sequeira</name>
        </developer>
        <developer>
            <id>estebanwasinger</id>
            <name>Esteban Wasinger</name>
        </developer>
        <developer>
            <id>alegmarra</id>
            <name>Alejandro Garcia Marra</name>
        </developer>
        <developer>
            <id>juandesi</id>
            <name>Juan Desimoni</name>
        </developer>
        <developer>
            <id>pablomusumeci</id>
            <name>Pablo Musumeci</name>
        </developer>
    </developers>
    <contributors>
        <!-- Refer to https://github.com/mulesoft/mule/graphs/contributors -->
    </contributors>
    <issueManagement>
        <system>jira</system>
        <url>http://www.mulesoft.org/jira/browse/MULE</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git://github.com/mulesoft/metadata-model-api.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/metadata-model-api.git</developerConnection>
        <url>https://github.com/mulesoft/metadata-model-api</url>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <javaVersion>1.8</javaVersion>
        <javaReleaseVersion>8</javaReleaseVersion>
        
        <surefire.args.mockito/>

        <licensePath>LICENSE_HEADER_CPAL.txt</licensePath>
        <licenseYear>2023</licenseYear>

        <muleModuleMavenPluginVersion>1.11.1</muleModuleMavenPluginVersion>
        <oldMuleArtifactVersion>1.10.1</oldMuleArtifactVersion>

        <muleApiAnnotationsVersion>1.10.1</muleApiAnnotationsVersion>
        <mockito.java8.version>4.11.0</mockito.java8.version>
        <wireMock.java8.version>2.27.2</wireMock.java8.version>
        <jetty.java8.version>9.3.30.v20211001</jetty.java8.version>

        <muleBomVersion>4.11.1</muleBomVersion>
    </properties>

    <modules>
        <module>metadata-model-api</module>
        <module>metadata-model-xml</module>
        <module>metadata-model-json</module>
        <module>metadata-model-java</module>
        <module>metadata-model-java-ast</module>
        <module>metadata-model-raml</module>
        <module>metadata-model-persistence</module>
        <module>metadata-model-mule</module>
        <module>metadata-model-catalog</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-bom</artifactId>
                <version>${jetty.java8.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mule</groupId>
                <artifactId>mule-runtime-bom</artifactId>
                <version>${muleBomVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mule</groupId>
                <artifactId>mule-tests-bom</artifactId>
                <version>${muleBomVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>api-annotations</artifactId>
                <version>${muleApiAnnotationsVersion}</version>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.java8.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>${mockito.java8.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.github.tomakehurst</groupId>
                <artifactId>wiremock</artifactId>
                <version>${wireMock.java8.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-junit5</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-module-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <configuration>
                    <compilerCompliance>${javaVersion}</compilerCompliance>
                    <compilerSource>${javaVersion}</compilerSource>
                    <compilerTargetPlatform>${javaVersion}</compilerTargetPlatform>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <release>11</release>
                            <!-- no excludes: compile everything to ensure module-info contains right entries -->
                        </configuration>
                    </execution>
                    <execution>
                        <id>base-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <release>${javaReleaseVersion}</release>
                            <!-- recompile everything for target VM except the module-info.java -->
                            <excludes>
                                <exclude>module-info.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <proc>none</proc>
                </configuration>
            </plugin>
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.mule.tools.maven</groupId>
                    <artifactId>mule-module-maven-plugin</artifactId>
                    <version>${muleModuleMavenPluginVersion}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>analyze</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>analyze</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.revapi</groupId>
                    <artifactId>revapi-maven-plugin</artifactId>
                    <configuration>
                        <oldVersion>${oldMuleArtifactVersion}</oldVersion>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <distributionManagement>
        <repository>
            <id>mule-releases</id>
            <name>Mule Release Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>mule-snapshots</id>
            <name>Mule Snapshot Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/snapshots</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>mule</id>
            <name>Mule Repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
        </repository>
    </repositories>

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

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <skipGpg>false</skipGpg>
                <skipNoSnapshotsEnforcerPluginRule>false</skipNoSnapshotsEnforcerPluginRule>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                    </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>
                        <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.raml:raml-parser-2</exclude>
                                                <exclude>org.raml:yagi</exclude>
                                            </excludes>
                                        </requireReleaseDeps>
                                    </rules>
                                    <skip>${skipNoSnapshotsEnforcerPluginRule}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
