<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>org.mule.runtime</groupId>
    <artifactId>api-annotations</artifactId>
    <version>1.5.1</version>
    <packaging>jar</packaging>
    <name>API Annotations</name>
    <description>Annotations used for Mule Module API definition</description>
    <url>https://github.com/mulesoft/api-annotations</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>dfeist</id>
            <name>Daniel Feist</name>
        </developer>
        <developer>
            <id>afelisatti</id>
            <name>Ana Felisatti</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>elrodro83</id>
            <name>Rodrigo Merino</name>
        </developer>
        <developer>
            <id>estebanwasinger</id>
            <name>Esteban Wasinger Espro</name>
        </developer>
        <developer>
            <id>juandesi</id>
            <name>Juani Desimoni</name>
        </developer>
        <developer>
            <id>alegmarra</id>
            <name>Alejandro Garcia Marra</name>
        </developer>
        <developer>
            <id>lucianoRM</id>
            <name>Luciano Raineri Marchina</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/api-annotations.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/api-annotations.git</developerConnection>
        <url>https://github.com/mulesoft/api-annotations</url>
    </scm>

    <properties>
        <javaVersion>1.8</javaVersion>
        <javaReleaseVersion>8</javaReleaseVersion>
        <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
        <xDocLint>-Xdoclint:none</xDocLint>
        <javaFormatter.plugin.version>2.14.0</javaFormatter.plugin.version>
        <formatterConfigPath>formatter.xml</formatterConfigPath>
        <formatterGoal>validate</formatterGoal>
        
        <mulesoftLicenseVersion>1.4.0</mulesoftLicenseVersion>
        <license.maven.plugin.version>4.2</license.maven.plugin.version>
        <licensePath>LICENSE_HEADER_CPAL.txt</licensePath>
        <licenseYear>2023</licenseYear>

        <maven.enforcer.plugin.version>1.4.1</maven.enforcer.plugin.version>
        <build.helper.maven.plugin.version>3.0.0</build.helper.maven.plugin.version>

        <maven.site.plugin.version>3.9.0</maven.site.plugin.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                    <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 and jpms specific stuff -->
                                <excludes>
                                    <exclude>module-info.java</exclude>
                                    <exclude>org/mule/api/annotation/jpms/**</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <encoding>ISO-8859-1</encoding>
                        <proc>none</proc>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.2.0</version>
                    <executions>
                        <execution>
                            <!-- Add the java 11 sources to the source artifact -->
                            <id>attach-java11-sources</id>
                            <!-- This has to run after compilation so it doesn't interfere with it (compler has its own MRJAR configuration) -->
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>src/main/java11</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${javaFormatter.plugin.version}</version>
                    <configuration>
                        <compilerCompliance>${javaVersion}</compilerCompliance>
                        <compilerSource>${javaVersion}</compilerSource>
                        <compilerTargetPlatform>${javaVersion}</compilerTargetPlatform>
                        <configFile>${basedir}/${formatterConfigPath}</configFile>
                        <configJsFile>${basedir}/${formatterConfigPath}</configJsFile>
                        <aggregator>false</aggregator>
                        <executionRoot>true</executionRoot>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>${formatterGoal}</goal>
                            </goals>
                            <configuration>
                                <skipFormatting>${skipVerifications}</skipFormatting>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <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-javadoc-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <additionalparam>${xDocLint}</additionalparam>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven.site.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build.helper.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>parse-version</id>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </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>

    <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>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalparam>${xDocLint}</additionalparam>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <skip>${skipGpg}</skip>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                    <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>
                                        </requireReleaseDeps>
                                        <requireReleaseVersion>
                                            <message>No Snapshots Allowed in Project Version!</message>
                                        </requireReleaseVersion>
                                        <requirePluginVersions>
                                            <message>Best Practice is to always define plugin versions!</message>
                                            <unCheckedPluginList>
                                                org.apache.maven.plugins:maven-source-plugin,
                                                org.apache.maven.plugins:maven-site-plugin,
                                                org.apache.maven.plugins:maven-javadoc-plugin,
                                                org.apache.maven.plugins:maven-resources-plugin,
                                                org.apache.maven.plugins:maven-surefire-plugin,
                                                org.apache.maven.plugins:maven-jar-plugin,
                                                org.apache.maven.plugins:maven-clean-plugin,
                                                org.apache.maven.plugins:maven-install-plugin,
                                                org.apache.maven.plugins:maven-deploy-plugin
                                            </unCheckedPluginList>
                                        </requirePluginVersions>
                                    </rules>
                                    <skip>${skipNoSnapshotsEnforcerPluginRule}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
