Loading

How to deploy mule extension with pom hierarchy to exchange

Udgivelsesdato: Aug 1, 2025
Opgave

GOAL

This article explains how to deploy a mule extension with a POM hierarchy to the exchange. POM hierarchy in a mule extension project is structured in such a way that, its POM file have parent POM, which in turn have its own parent POM and so on.

Trin
  • Below is the sample for mule extension POM and its parent POM, it's a simple example of a hierarchy where there is a parent POM for a mule extension.

    Mule Extension POM :

<?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>{organization_id}</groupId>
  <artifactId>mule-basic-extension</artifactId>
  <version>1.0.5</version>
  <packaging>mule-extension</packaging>
  <name>Basic Extension</name>
  <parent>
    <groupId>{organization_id}</groupId>
    <artifactId>modules-parent</artifactId>
    <version>1.0.0</version>
    <relativePath>../parent</relativePath>
  </parent>
 <distributionManagement>
   <repository>
    <id>{repository_id}</id>
    <name>{repository_name}</name>
    <url>https://maven.anypoint.mulesoft.com/api/v1/organizations/{organization_id}/maven</url>
    <layout>default</layout>
   </repository>
</distributionManagement>
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-install-plugin</artifactId>
      <version>2.5.2</version>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-deploy-plugin</artifactId>
      <version>2.8.2</version>
    </plugin>
   </plugins>
</build>
 <dependencies>
   <dependency>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-imaging</artifactId>
     <version>1.0-SNAPSHOT</version>
    </dependency>
 </dependencies>
</project>
  • Parent POM : 

<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.extensions</groupId>
    <artifactId>mule-modules-parent</artifactId>
    <version>1.1.2</version>
    <relativePath/>
  </parent>
 <distributionManagement>
  <repository>
   <id>{repository_id}</id>
   <name>{repository_name}</name>
   <url>https://maven.anypoint.mulesoft.com/api/v1/organizations/{organization_id}/maven</url>
   <layout>default</layout>
  </repository>
 </distributionManagement>
 <groupId>{organization_id}</groupId>
 <artifactId>modules-parent</artifactId>
 <version>1.0.0</version>
 <packaging>pom</packaging>
</project>
  • To deploy a mule extension to the exchange, group id in pom.xml should be an organization id of an organization where an asset is to be deployed.
  • In both of the mule extension POM and parent POM in the example above, the below parameters should be replaced with the appropriate values.
    1. {organization_id}: Organization Id of an organization to which asset is to be deployed.
    2. {repository_id} and {repository_name}: It should match repository details defined in settings.xml in .m2 folder of user home directory as it takes credentials for user from settings.xml.
  • Once the POM files are updated, go to the parent POM directory and execute - mvn deploy.
  • It will deploy parent POM to exchange.
  • Go to the mule extension POM directory and execute - mvn deploy.
  • It will deploy mule extension to the exchange.
  • If there is a hierarchy of POM files, then all of the parent pom files should be deployed first, in the same way, starting with a root POM file.
  • Once all the parent pom files are deployed then mule extension can be deployed to exchange.
Vidensartikelnummer

001114531

 
Indlæser
Salesforce Help | Article