---
schema_version: "1"
id: ea763d7bd7a234414b8999a219999de7119220d30a3431554e09f6ee89c727c6
title: Maven Support in Mule
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.9/using-maven-with-mule.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.9/using-maven-with-mule
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 10f3ab414ece09ca9d1af4ebc45cb3ad79138285479033de9985ef42309ef43f
description: MuleSoft Documentation Site
release: "4.9"
latest: false
---
---
product: Mule Runtime
version: 4.9
keywords: studio, maven, version control, dependencies, libraries, runtime
---

# Maven Support in Mule

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

> [!WARNING] Mule Maven plugin versions 3.0.0, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6,
> 3.1.7, and 3.8.3 are deprecated.

Maven is a project management utility that Mule implements to enhance project development. Mule
provides built-in Maven functionality, including the following features:

- Anypoint Exchange

  - Connectors in Anypoint Exchange provide Maven dependency information. In Anypoint Exchange, you
    can click a connector asset and click **Dependency Snippets** to list the Maven `pom.xml` file
    dependency.

- Anypoint Studio

  - All new projects created in Anypoint Studio 7 and later are configured with Maven by default.
    You can run the project with Maven from the command line, or run it directly from Anypoint
    Studio.

  - You can import an existing Maven project into Anypoint Studio and continue working on it. See
    [Importing and Exporting Projects](https://docs.mulesoft.com/studio/import-export-packages) for more details.

- Mule Runtime Engine

  - You can integrate the packaging, testing, and deployment of your Mule applications with your
    Maven lifecycle using the [Mule Maven plugin](https://docs.mulesoft.com/mule-runtime/4.9/mmp-concept).

## Prerequisites

You must be familiar with Maven concepts like managing `pom.xml` files and working with Maven
plugins. If you are just getting started with Maven, we suggest you follow
[Maven’s Getting Started tutorial](https://maven.apache.org/guides/getting-started/).

## Benefits

Maven facilitates the management of your Mule applications both inside and outside of Anypoint
Studio, providing the following benefits:

- When you create a new Mule project using Anypoint Studio, you can be confident that you are
  working with the correct Mule project folder structure and the basic set of standard dependencies.

- Anypoint Studio automatically manages your POM file every time you add new elements to your flow
  that require additional dependencies.

- The Maven POM file makes sharing projects easier and more lightweight because the POM references
  the dependencies so that you don’t have to manually find and include every dependency within the
  project itself.

- Using Maven to manage the builds ensures that the resulting final build is sanitized and
  standardized.

- You can program automatic builds using external frameworks such as Bamboo for continuous
  integration.

## Recommendations

- Use Anypoint Studio to design your applications.

  Anypoint Studio’s built-in Maven support minimizes the chances that you would have to manually
  update your POM file with new dependencies as you add to, or modify your applications.

- Update your POM file and `settings.xml` when necessary.

  When updating your POM file, the `<packaging>…</packaging>` tag is mandatory. Depending on the
  type of project you are creating, valid values for this tag are `mule-application`, `mule-domain`,
  `mule-policy`, and `mule-domain-bundle`. For example, if you create a Mule project using Anypoint
  Studio, the tag is automatically configured as `<packaging>mule-application</packaging>`.

  If you create Maven projects from the command line using archetypes, you need to manage your POM
  file manually, and in some cases, adjust your `settings.xml` file to point to the MuleSoft
  Enterprise repository and supply credentials. In some cases, even if you manage your project with
  Anypoint Studio, you may need to make manual adjustments to your POM as well.

- Use SNAPSHOT version.

  SNAPSHOT enables you to identify versions of your project as you work toward producing a stable
  product to release. For example, you can build a `1.0.0-SNAPSHOT` version of your project, test
  functionality, make changes, etc. until you are ready to release it as version `1.0.0`. Then you
  can build upon using a new version, `1.1.0-SNAPSHOT`.

  Example XML:

  ```xml
  <groupId>com.mycompany</groupId>
  <artifactId>my-application</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>mule-application</packaging>
  ```

> [!NOTE] When using Maven for dependency management, use caution when including third-party
> components in your projects. While MuleSoft maintains a secure repository, we cannot guarantee the
> safety of components from external sources. Malicious attackers can create fake components and
> distribute them on third-party repositories. Research and vet all third-party components before
> incorporating them into your projects. This helps ensure the security and integrity of your
> applications.

## Configure Your Maven Installation

Even though Anypoint Studio automatically configures Maven to work with Mule when you create a new
project, some scenarios require you to manually configure your Maven installation to work with Mule;
for example when following continuous integration or continuous deployment (CI/CD) practices.

When you manage your Maven installation, ensure that:

- The `settings.xml` file is properly configured.

  - Configure your [Maven preferences](https://docs.mulesoft.com/studio/maven-preferences-reference) in Anypoint Studio
    to point to your Maven installation.

  - Configure access to [MuleSoft repositories](https://docs.mulesoft.com/mule-runtime/4.9/maven-reference#configure-mule-repositories).

- The `pom.xml` file is properly configured.

  If you update your project outside Studio, keep the `pom.xml` file updated with any necessary
  adjustments.

For additional information about Maven configuration, see the [Maven Reference](https://docs.mulesoft.com/mule-runtime/4.9/maven-reference).

## See Also

- [Apache Maven](https://maven.apache.org/)

- [Adjusting your Maven Preferences in Anypoint Studio](https://docs.mulesoft.com/studio/maven-preferences-reference)

- [Importing and Exporting Projects in Anypoint Studio](https://docs.mulesoft.com/studio/import-export-packages)

- [Mule Maven plugin](https://docs.mulesoft.com/mule-runtime/4.9/mmp-concept)

- [Maven Reference](https://docs.mulesoft.com/mule-runtime/4.9/maven-reference)
