---
schema_version: "1"
id: 60d62b0471a3106cebc9c480b2731577fc75c86d4fdeba3b242f08cc681fe717
title: Publishing Unified-Model Policies to Exchange
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/pdk/latest/policies-pdk-publish-policies.md
canonical_url: https://docs.mulesoft.com/pdk/latest/policies-pdk-publish-policies
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 097abeb160f5bd6160bddbe4828873dbce61ab15bce93759d6506d590ad5d935
description: MuleSoft Documentation Site
release: "1.10"
latest: true
---
---
product: Omni Gateway Policy Development Kit (PDK)
version: 1.10
is-latest-version: true
---

# Publishing Unified-Model Policies to Exchange

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

During the custom policy development cycle, you can upload your policy to Exchange to create a new
Exchange asset to manage the policy’s version and to distribute it to other users. For more
information about Exchange, see [Anypoint Exchange Overview](https://docs.mulesoft.com/exchange/).

For custom policies running in Local Mode, it is not required to publish your policy to Exchange.
However, Exchange is a useful version control tool. It is your responsibility to distribute custom
policies for Local Mode use.

When uploading your policy to Exchange, you can choose to either:

- [Publish a Custom Policy](#publish)  
  Publish a policy if the policy version is still in development. This enables you to test and edit
  the policy version.

- [Release a Custom Policy](#release)  
  Release the policy to create a definitive version of the policy. After releasing the policy, you
  must create a new policy version to edit the policy.

Every time you publish or release a policy, you create a new `stable` asset in Exchange. For more
information about `stable` state assets, see
[Stable State Assets](https://docs.mulesoft.com/exchange/lifecycle#stablet-state).

After you upload your policy to Exchange, see
[Applying Custom Policies](https://docs.mulesoft.com/pdk/latest/policies-pdk-apply-policies).

## Before You Begin

- Ensure that the Connected App you used to authenticate to the
  [Anypoint Platform CLI](https://docs.mulesoft.com/pdk/latest/policies-pdk-prerequisites#cli) has the `Exchange Contributor` scope
  applied.

- [Compile your Policy](https://docs.mulesoft.com/pdk/latest/policies-pdk-compile-policies).

## Publish a Custom Policy

To publish a custom policy, run the `make publish` command from the policy’s root folder:

```ssh
make publish
```

After publishing the asset, a new asset labeled `DEV` appears in Exchange:

![Policy appears in Exchange labeled DEV.](/mulesoft/current/en-us/pdk/latest/_images/pdk-dev-asset.png)

The asset’s group ID, asset ID, and asset version (GAV) appear, similar to the following:

- **groupID**: `<organizationId>`

- **assetID**: `my-custom-policy-dev`

  When publishing a policy, `-dev` appears appended to the **assetID**.

- **version**: `1.0.0-20230618115723`

  When publishing a policy, a timestamp appears appended to the **version**.

Rerunning the publish command creates a new version of the policy asset with an updated timestamp.
Previously published policy versions are still available.

## Skip Republishing an Unchanged Definition

Running `make publish` or `make release` uploads a new policy definition and policy implementation
to Exchange. If the policy definition is unchanged from the published version, PDK skips
republishing the definition and reuses the existing one. The publication step reports this message
if the definition is skipped:

```text
Definition unchanged from published version x.y.z. Skipping definition publish and reusing it.
```

> [!NOTE] This feature is only applicable to policies created with PDK 1.10.0 or later, not policies
> created with an earlier version that were updated.

When the definition is reused, you only need to update the policy implementation. See
[Upgrade a Policy Implementation](https://docs.mulesoft.com/gateway/latest/gateway-secure-conn#upgrade-policy-implementation).

To always publish a new definition, set the `SKIP_UNCHANGED_DEFINITION` flag to `false` in the
Makefile:

```makefile
SKIP_UNCHANGED_DEFINITION ?= false
```

## Release a Custom Policy

To release a custom policy, run the `make release` command from the policy’s root folder:

```ssh
make release
```

Released policies are not labeled `DEV`. The asset’s GAV appears similar to the following:

- **groupID**: `<organizationId>`

- **assetID**: `my-custom-policy`

  Released policies do not have `-dev` appended to their **assetID**.

- **version**: `1.0.0`

  Released policies do not have a timestamp appended to their **assetID**.

After releasing the asset, rerunning the `make release` command results in a conflict error.

To begin working on the next version of your policy, update the version number in the `Cargo.toml`
file.

For example, if the latest version is `1.0.0`, update the `Cargo.toml` file as follows to begin
working on a minor release:

```toml
name = "my-custom-policy"
version = "1.1.0"
```

## See Also

- [Applying Custom Policies](https://docs.mulesoft.com/pdk/latest/policies-pdk-apply-policies)

- [PDK Troubleshooting](https://docs.mulesoft.com/pdk/latest/policies-pdk-troubleshooting)
