<?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>com.mulesoft.connectivity</groupId>
        <artifactId>connectivity-mule-adapter</artifactId>
        <version>1.0.0</version>
    </parent>

    <artifactId>connectivity-mule-pulse-test-connector</artifactId>

    <name>Mule Pulse Test Connector</name>
    <description>Mule Test Connector for testing Runtime Extension</description>

    <properties>
        <formatterConfigPath>../formatter.xml</formatterConfigPath>
        <javaModuleName>com.mulesoft.connectivity.pulse.test</javaModuleName>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>com.mulesoft.connectivity</groupId>
            <artifactId>connectivity-mule-language</artifactId>
            <classifier>dw-library</classifier>
            <version>${ic.data.weave.service.api.version}</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.mule.runtime.plugins</groupId>
                <artifactId>mule-extensions-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.mulesoft.connectivity</groupId>
                <artifactId>connectivity-mule-maven-plugin</artifactId>
                <version>${project.version}</version>
                <configuration>
                    <dwRef>pulseConnector::Connector::connector</dwRef>
                </configuration>
                <executions>
                    <execution>
                        <id>build-static-metadata</id>
                        <goals>
                            <goal>createMuleStaticModel</goal>
                            <goal>validateConnectorModel</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <!-- Configure the Maven Jar Plugin to generate an additional JAR file with a specific classifier and custom manifest entries -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <executions>
                        <execution>
                            <!-- Configure the Maven Jar Plugin to generate an additional JAR file with a classifier 'mule-plugin' -->
                            <id>default-mule-plugin-jar</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <classifier>mule-plugin</classifier>
                                <archive>
                                    <manifestEntries>
                                        <!-- Add the Automatic-Module-Name entry to the JAR manifest -->
                                        <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
                                    </manifestEntries>
                                </archive>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
