Publish Mule App as an asset

  • Change the groupId in pom.xml to Anypoint platform org id. Replace ORGANIZATION_ID with the org id.

  • Name, Description in pom.xml and classifier to specify the asset type in the mule maven plugin configuration tag as shown below

<name>Contacts API</name>
<description>A mule application to get contacts from external systems</description>
						<classifier>mule-application-example</classifier> <!-- This is required when publishing assets -->
						<!-- To deploy, cloudhub deployment comes here -->

  • Distribution Management should be added to the pom to publish the asset. Here the ORGANIZATION_ID is the id of the Anypoint Platform org id.

      <name>Corporate Repository</name>

  • Once this is added, the repo credentials should be configured in maven's ~/.m2/settings.xml


Adding Mutable data

  • To add mutable data such as categories/tags, the following properties can be added as below

			<categories key="categoryKey">someValue</categories>
			<fields key="fieldKey">someValue</fields>

  • For these categories to work, they have to be configured in Exchange settings in Anypoint platform.

Adding Documentation for asset

  • To add documentation, first in src/main/resources, create docs folder. Include each documentation page as a markdown files. The page order can be specified by having an optional config.json with pageOrder key as shown below. In the pageOrder array, specify the pages as a string in page order. example, → main and → examples. (["main","examples")

 "pageOrder": ["main"]

  • For the maven to do the magic, add assembly plugin to the pom.xml and create docs-assembly in resources folder to hold assembly.xml

										<!-- This tells maven where to look for assembly descriptor.-->

  • assembly.xml can look like this

<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="<>"
         xsi:schemaLocation="<> <>">
   <id>docs</id> <!-- Specifying what we are trying to assemble -->
       <format>zip</format> <!-- Assemble to which format -->
           <directory>${project.basedir}/src/main/resources/docs</directory> <!-- Location of markdown files -->
           <outputDirectory>/</outputDirectory> <!-- where to output the built zip -->

  • Once the above settings are done, use maven to deploy to exchange.

mvn deploy
  • If you have some custom asset to deploy, tweak the pom.xml by adding maven exchange plugin as below (OPTIONAL - ONLY FOR CUSTOM ASSETS)

                  <goal>exchange-pre-deploy</goal> <!-- Validate before deploying to exchange-->
                  <goal>exchange-deploy</goal> <!-- Deploy goal to exchange -->

18 views0 comments

Recent Posts

See All