# Managing monorepo projects

The monorepo feature is supported starting in [Enterprise Edition](https://www.sonarsource.com/plans-and-pricing/enterprise/). It requires that the DevOps platform integration with GitHub, GitLab, Azure DevOps, or Bitbucket has been properly set up.

{% hint style="warning" %}
The blocking of pull request merge when the quality gate fails is not supported for monorepos.
{% endhint %}

For information about how to add a SonarQube Server analysis to your monorepo pipeline, see **If you use a monorepo** on the [adding-analysis-to-gitlab-ci-cd](https://docs.sonarsource.com/sonarqube-server/2025.2/devops-platform-integration/gitlab-integration/adding-analysis-to-gitlab-ci-cd "mention") or [adding-analysis-to-github-actions-workflow](https://docs.sonarsource.com/sonarqube-server/2025.2/devops-platform-integration/github-integration/adding-analysis-to-github-actions-workflow "mention") page; or [monorepo-projects](https://docs.sonarsource.com/sonarqube-server/2025.2/devops-platform-integration/azure-devops-integration/adding-analysis-to-pipeline/monorepo-projects "mention").

## What is a monorepo? <a href="#what-is-a-monorepo" id="what-is-a-monorepo"></a>

Traditionally, software projects have been organized so that each project is stored within a single, distinct repository of its own.

As software projects have become more complex and interconnected, some organizations have moved to having all their projects in a single large repository. This is called the monorepo strategy.

In a typical monorepo, each project occupies its own directory within the repository and each is independently buildable and deployable, though the exact setup depends on how the procedures that build each project are defined. In general, there are many ways that multiple projects can be arranged within a single repository.

Fortunately, SonarQube Server’s support for the monorepo strategy does not depend on the specifics of the monorepo setup. SonarQube Server relies on the fact that each build procedure can be configured to perform the analysis for its particular project in the repository and send the result to the corresponding SonarQube Server project.

## Monorepo setup in SonarQube Server <a href="#monorepos-on-sonarqube" id="monorepos-on-sonarqube"></a>

In a monorepo setup, multiple SonarQube Server projects, each corresponding to a separate monorepo project, are all bound to the same repository. This way:

* The analysis setup of each project in the monorepo is easier.
* The quality gate status report of pull requests in your DevOps platform is clearly distinguished by project name.
* The monorepo associated with a project is shown in the SonarQube Server UI.

Each SonarQube Server project must have a key unique across SonarQube Server (see [analysis-parameters](https://docs.sonarsource.com/sonarqube-server/2025.2/analyzing-source-code/analysis-parameters "mention")). This is the key that you will use when you configure your CI service. It binds the project in the monorepo to its corresponding SonarQube Server project. We recommend using a pattern that includes your organization name, the SonarQube Server project name, and an internal reference to the project within the monorepo.

## Creating the projects of a monorepo (Importing a monorepo) <a href="#create-projects" id="create-projects"></a>

To create the projects of a monorepo, you need the **Create Projects** permission in SonarQube Server.

Proceed as follows:

1. In the top navigation bar of SonarQube Server, select **Projects**.
2. In the top right corner, select **Create Project > From \[DevOps platform]**. The **Project onboarding** page opens.
3. Select **Set up a monorepo**. The **Monorepo project onboarding** page opens.
4. Select the monorepo you want to import. The **Create new projects** section opens with a first project.
5. Check and complete the proposed project name and key.
6. Select **Add new project** to add additional projects.
7. Once you’ve completed the project list, select **Next**. The **Set up new projects for Clean as You Code** page opens.
8. Select the [about-new-code](https://docs.sonarsource.com/sonarqube-server/2025.2/user-guide/about-new-code "mention") to be applied by default to the SonarQube Server projects in the monorepo. Once the projects have been created, you can change the new code definition applying to a given project: see below.
9. Select **Create projects**. The **Projects** page opens and displays the newly created projects at the top.

{% hint style="info" %}
If you configure in the **Monorepo project onboarding** page a repository already bound to a standard project then this standard project will be converted to a monorepo project.
{% endhint %}

## Removing a project from a monorepo <a href="#remove-project" id="remove-project"></a>

You can remove a project from a monorepo provided you are an administrator of the project:

1. Go to the project page.
2. Select **Project settings > General settings > \[DevOps platform] Integration** and uncheck **Enable monorepo support**.\
   Re-selecting the option brings the project back to its monorepo.

{% hint style="info" %}
You can delete a project belonging to a monorepo the same way as you delete any SonarQube Server project (**Project settings > Deletion**).
{% endhint %}

## Modifying the new code definition of a project in a monorepo <a href="#modify-project-new-code-def" id="modify-project-new-code-def"></a>

You can set up a different [about-new-code](https://docs.sonarsource.com/sonarqube-server/2025.2/user-guide/about-new-code "mention") definition for each project in the monorepo provided you are an administrator of the project.

To set up a new code definition for a given project:

1. Open your project in SonarQube Server.
2. Go to **Project Settings > New Code**.
