MPL-2.0 Guide

MPL-2.0, also called the Mozilla Public License 2.0, is a Weak Copyleft license that requires disclosure of source code on a per-file basis.

SPDX Identifier: MPL-2.0

License Text in the Source Code

Open source under the MPL-2.0 license generally includes the following text at the top of the source code.

This Source Code Form is subject to the terms of the Mozilla Public
License, v.2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.

Obligations by Use Case

Case 1. Redistribution in Source Form

When redistributing open source under the MPL-2.0 license in source form, observe the following.

1-1 Notice Obligation

  • Provide or reference a copy of the license
  • Do not modify legal notices

That is, redistribute while keeping the license information stated in the source code intact.

Case 2. Redistribution in Binary Form

When building open source under the MPL-2.0 license and redistributing it only in binary form, observe the following.

2-1 Notice Obligation

  • Provide a copy of the license

Generate an open source notice that includes the above and include it when redistributing the binary.

2-2 Obligation to Provide Source Code

Provide the source code files under MPL-2.0 within the binary. In doing so, observe the following.

  • MPL-2.0 requires that content added within a file also apply MPL-2.0 and disclose its source code. Therefore, disclose both the original file and the modified file by applying MPL-2.0.

You can fulfill the obligation to provide source code by indicating in the open source notice how users can obtain the source code.

Per-File Copyleft

The key characteristic of MPL-2.0 is that Copyleft is applied on a per-file basis.

  • When modifying an MPL-2.0 file: Disclose only that file under MPL-2.0
  • When adding a separate file: The added file does not need to be disclosed
  • When combining with other licenses: Combination is possible if the files are separated

Because of these characteristics, it can be used flexibly in commercial software development.

License Compatibility

Compatibility with Major Licenses

Combining LicenseCompatibleNotes
MITCompatibleDisclose only MPL files
Apache-2.0CompatibleDisclose only MPL files
GPL-2.0/3.0CompatibleLeverage the Secondary License clause
LGPL-2.1/3.0CompatibleDisclose only MPL files
ProprietaryCompatibleUsable as long as only MPL files are disclosed

Here, “Compatible” means the files can be combined or distributed together while the MPL files keep their source-disclosure obligation. It does not mean MPL is a permissive license.

References