---
schema_version: "1"
id: e8938215814e25099e82ac42b2c3161d5e686cdcc13e5b016c97a07622c6fba1
title: Export Resources
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.4/how-to-export-resources.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.4/how-to-export-resources
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 986a28a05d568ac8360ae327f9a0bd4c270aa43ded33ca0cdf99965610f7d12a
description: MuleSoft Documentation Site
release: "4.4"
latest: false
---
---
product: Mule Runtime
version: 4.4
---

# Export Resources

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

Mule Applications, Mule Domains and Mule Policies contain a set of resources which may be properties
files, DataWeave transformation files, Java classes, etc. By default, all of these files are
internal to the artifact in which they are defined, and as a result, they are inaccessible from
other artifacts. For instance, if a resource defined at the domain level is not explicitly exported,
then it cannot be accessed from within any of the applications that belong to that shared domain.
Another example is classes from an application that are meant to be used by the Java module. If
those classes are not exported, then the Java module will not be able to access them.

## How to Export Java Classes

To export Java classes, you have to export the complete package that contains them by using the
`exportedPackages` field of the `mule-artifact.json` file of your artifact. Individual classes
cannot be exported.

Use `.api.` when naming public packages and `.internal.` when naming your non-public packages to
make them easier to identify.

```json
{
  "name": "MyApp",
  "minMuleVersion": "4.0.0",
  "classLoaderModelLoaderDescriptor": {
    "id": "mule",
    "attributes": {
      "exportedPackages": ["org.mule.myapp.api.customer", "org.mule.myapp.api.account"]
    }
  }
}
```

Any internal dependencies in your Java classes are automatically exported with this configuration.

### Considerations

- Export the minimum number of packages required for your application to work

  This reduces the likelihood of conflicts with other artifacts, such as modules or connectors, that
  you might be using within your application.

- Configure shared libraries if any component in your Mule app needs to access the exported packages

  Due to the classloading isolation mechanism implemented in Mule, connectors and modules cannot
  access application dependencies unless these dependencies are configured as shared libraries.

## How to Export Resource Files

To export resources, use the `exportedResources` field of the `mule-artifact.json` file for your
artifact.

```json
{
    "name": "MyApp",
    "minMuleVersion": "4.0.0",
    "classLoaderModelLoaderDescriptor": {
        "id": "mule",
        "attributes": {
            "exportedResources": [
                "/org/mule/myapp/customer-to-user.dwl",
                "/org/mule/myapp/beans.xml"
            ]
        }
    }
  }
}
```

> [!IMPORTANT] This same mechanism applies to every artifact, including custom extensions developed
> with the Mule SDK.

## See Also

- [Shared Libraries](https://docs.mulesoft.com/mule-runtime/4.4/about-classloading-isolation#shared-libraries)

- [Configure Shared Libraries](https://docs.mulesoft.com/mule-runtime/4.4/mmp-concept#configure-shared-libraries)
