<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>
    <groupId>cloud.anypoint</groupId>
    <artifactId>mule-whisperer-connector</artifactId>
    <version>0.4.0</version>
    <packaging>mule-extension</packaging>
    <name>MAC Whisperer Connector</name>
    <description>MAC Whisperer Connector provides capabilities to convert speech to text or text to speech.</description>
    <url>https://mac-project.ai/docs/mac-whisperer/connector-overview</url>
    <scm>
        <connection>scm:git:git://github.com/anypointcloud/mac-whisperer.git</connection>
        <developerConnection>scm:git:git@github.com:anypointcloud/mac-whisperer.git</developerConnection>
        <url>https://github.com/anypointcloud/mac-whisperer/tree/master</url>
      <tag>v0.4.0</tag>
  </scm>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <parent>
        <groupId>org.mule.extensions</groupId>
        <artifactId>mule-modules-parent</artifactId>
        <version>1.9.6</version>
    </parent>

    <properties>
        <muleJavaEeBomVersion>4.6.0</muleJavaEeBomVersion>
		<formatterConfigPath>formatter.xml</formatterConfigPath>
		<javaFormatter.plugin.version>2.0.1</javaFormatter.plugin.version>
		<formatterGoal>validate</formatterGoal>
        <munit.extensions.maven.plugin.version>1.5.0</munit.extensions.maven.plugin.version>
        <munit.version>3.4.0</munit.version>
        <maven.surefire.version>3.2.5</maven.surefire.version>
        <runtimeProduct>MULE_EE</runtimeProduct>
    </properties>

   <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.mule</groupId>
                <artifactId>mule-javaee-runtime-bom</artifactId>
                <version>${muleJavaEeBomVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- REQUIRED: Pure Java MP3 decoder -->
        <dependency>
            <groupId>javazoom</groupId>
            <artifactId>jlayer</artifactId>
            <version>1.0.1</version>
        </dependency>

        <!-- OPTIONAL: User provides if they need M4A/AAC/FLAC/OGG/WEBM support -->
        <!-- Platform-specific variants (e.g., ffmpeg-platform-linux-x86_64) are also supported -->
        <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>ffmpeg-platform</artifactId>
            <version>6.1.1-1.5.10</version>
            <optional>true</optional>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.sdk</groupId>
            <artifactId>mule-sdk-api</artifactId>
            <version>0.11.4</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20240303</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.16.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <version>1.24.0</version>
        </dependency>

        <dependency>
            <groupId>io.github.givimad</groupId>
            <artifactId>whisper-jni</artifactId>
            <version>1.7.1</version>
        </dependency>

        <!-- API, java.xml.bind module -->
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>2.3.2</version>
            <scope>test</scope>
        </dependency>

        <!-- Runtime, com.sun.xml.bind module -->
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.2</version>
            <scope>test</scope>
        </dependency>

        <!-- JUnit Jupiter for diagnostic testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.10.0</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.mulesoft.munit</groupId>
                <artifactId>munit-extensions-maven-plugin</artifactId>
                <version>${munit.extensions.maven.plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                    </execution>
                </executions>
                <configuration>
                    <!-- Use connector's minimum Mule version (same as inference connector) -->
                    <minMuleVersionConfig>CONNECTOR</minMuleVersionConfig>
                    <sharedLibraries>
                        <!-- WhisperJNI and audio processing dependencies -->
                        <sharedLibrary>
                            <groupId>io.github.givimad</groupId>
                            <artifactId>whisper-jni</artifactId>
                        </sharedLibrary>
                        <sharedLibrary>
                            <groupId>org.bytedeco</groupId>
                            <artifactId>ffmpeg-platform</artifactId>
                        </sharedLibrary>
                        <sharedLibrary>
                            <groupId>javazoom</groupId>
                            <artifactId>jlayer</artifactId>
                        </sharedLibrary>
                    </sharedLibraries>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.mulesoft.munit</groupId>
                        <artifactId>munit-tools</artifactId>
                        <version>${munit.version}</version>
                        <classifier>mule-plugin</classifier>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <checksums>all</checksums>
                            <deploymentName>${project.artifactId}-${project.version}</deploymentName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

	<repositories>
        <repository>
            <id>mule-releases</id>
            <name>Nexus Public Releases</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases/</url>
        </repository>
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>mulesoft-releases</id>
			<name>mulesoft release repository</name>
			<layout>default</layout>
			<url>https://repository.mulesoft.org/releases/</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>

</project>
