Contact Free trial Login

Uploading a Custom Policy to Exchange

Exchange provides an API to publish or consume assets using a Maven client. You must have a unique artifact name and organization ID to publish your asset.
See the Maven facade API Exchange asset for more details.

API Manager lists custom policies published as assets of your organization.

Deploying a Policy Created Using the Maven Archetype

When you create your custom policy project using the provided Maven archetypes, all the necessary plugins for uploading the policy to Exchange are already defined for you.
See the Setting up a project with the archetype instructions for more information.

You must configure your Exchange credentials:

  1. Update the settings.xml file in your Maven .m2 directory with your Exchange credentials.

    <?xml version="1.0" encoding="UTF-8"?>
    <settings xmlns=""
  2. Run mvn deploy to publish the policy to Exchange.

The custom policy is now available for you to apply to APIs that belong to the specified organization.

Deploying a Policy Created Without Using the Maven Archetype

If you chose not to create your custom policy project using the provided Maven archetypes, you need to manually set up your Exchange deployment configurations:

  1. In Anypoint Platform, search your organization’s ID to use in the following steps.

    • Go to Access Management > Organization:

      • Click the name of your organization.

      • Copy the UUID from the browser address. For example, copy 2a4b93c3-7899-4ea7-9374-f787744d8784 from the URL.

  2. Go to your pom.xml

  3. Replace the groupId with the organization’s ID from the previous step.

  4. Add the following properties replacing the {orgId} for the organization’s id from the previous steps:

      <mule.maven.plugin.version>3.2.0</mule.maven.plugin.version> <!-- check for last available version -->
  5. Additonally, in your pom.xml file, define Exchange as a repository:

    	<name>MuleSoft Exchange Environment</name>
  6. Set up your Exchange server as a distribution management:

            <name>Corporate Repository</name>
  7. Additionally, add the following build plugins:

    • Mule Maven Plugin: Verifies that all necessary files are present and it is require to correctly package policy.

    • Maven Deploy Plugin: Communicates with the exchange repository, and uploads the policy jar and yaml files.


      And the following plugin repository

              <name>Mule Repository</name>
  8. Set up your Exchange credentials in the settings.xml file in your Maven .m2 directory:

    <settings xmlns=""
  9. Finally, deploy the policy using the following command: mvn clean deploy.

    The IDs defined for your Exchange repositories must match.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.