Can I use Mozilla Public License 1.1 (MPL) in a commercial app?
Categories:
Navigating MPL 1.1 in Commercial Applications: A Comprehensive Guide

Explore the nuances of using the Mozilla Public License 1.1 (MPL 1.1) in commercial software, understanding its implications for proprietary code and distribution.
The Mozilla Public License 1.1 (MPL 1.1) is a unique open-source license that strikes a balance between permissive and copyleft licenses. It's often chosen for projects where developers want to encourage contributions while allowing the integration of their code into proprietary applications. However, understanding its specific requirements, especially when used in a commercial context, is crucial to avoid legal pitfalls. This article will demystify MPL 1.1, focusing on its implications for commercial software development and distribution.
Understanding MPL 1.1: Key Characteristics
MPL 1.1 is a 'file-level copyleft' license. This means that any modifications to files licensed under MPL 1.1 must also be licensed under MPL 1.1 and made publicly available. However, it does not 'infect' other files in your project. You can combine MPL 1.1 licensed code with proprietary code in the same application without requiring your proprietary code to be open-sourced. This characteristic makes it particularly attractive for commercial entities looking to leverage open-source components.
flowchart TD A[Start with MPL 1.1 Licensed File] --> B{Modify File?} B -->|Yes| C[Modified File Must Remain MPL 1.1] C --> D[Distribute Modified File?] D -->|Yes| E[Make Source Code Publicly Available] B -->|No| F[Use Original MPL 1.1 File] F --> G{Combine with Proprietary Code?} G -->|Yes| H[Proprietary Code Can Remain Closed Source] H --> I[Distribute Combined Application] I --> J[Ensure MPL 1.1 Compliance for MPL-Licensed Parts] E --> J
Flowchart illustrating MPL 1.1 licensing implications for file modification and combination with proprietary code.
Commercial Use and Distribution Requirements
When incorporating MPL 1.1 licensed software into a commercial application, several key requirements must be met:
- Source Code Availability: If you modify an MPL 1.1 licensed file and distribute the resulting application, you must make the source code of the modified MPL 1.1 file available to recipients. This typically means providing a copy of the source code or a clear written offer to provide it.
- Attribution: You must retain all copyright, patent, trademark, and attribution notices from the original MPL 1.1 licensed code.
- No Sub-licensing Restrictions: You cannot impose any further restrictions on the use, modification, or distribution of the MPL 1.1 licensed code beyond what the MPL 1.1 itself permits.
- Separate Licensing for Proprietary Code: Your proprietary code, which links to or uses the MPL 1.1 code, can be licensed under different terms, including proprietary ones. The MPL 1.1 only applies to the files it covers.
Practical Example: Integrating RabbitMQ Client Libraries
A common scenario involves using client libraries for messaging systems like RabbitMQ. Many RabbitMQ client libraries, such as the official Java client, are licensed under MPL 1.1. Let's consider how this works in a commercial Java application.
If your commercial Java application uses the RabbitMQ Java client library (which is MPL 1.1 licensed) without modifying the client library's source code, you generally only need to ensure that the MPL 1.1 license text is included with your distribution and that proper attribution is given. Your application's proprietary code remains proprietary.
However, if you were to modify the RabbitMQ client library itself (e.g., to add custom features or fix bugs within the client library's source files), then you would be obligated to distribute the source code of your modified client library under MPL 1.1 to anyone who receives your application.
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;
public class MyCommercialApp {
private final static String QUEUE_NAME = "hello";
public static void main(String[] argv) throws Exception {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
try (Connection connection = factory.newConnection();
Channel channel = connection.createChannel()) {
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
String message = "Hello World!";
channel.basicPublish("", QUEUE_NAME, null, message.getBytes("UTF-8"));
System.out.println(" [x] Sent '" + message + "'");
}
}
}
Example of a Java application using the RabbitMQ client library. The application's code can remain proprietary, while the client library's MPL 1.1 license must be respected.