29

I want to license my project (hosted on GitHub) under MPL-2.0, which looks like a reasonable choice. But since I'm not a lawyer, it's hard to estimate long-term benefits and consequences of this choice. Specifically, I have the following questions:

  1. Am I allowed to distribute the project for money under this license?
  2. What are permitted licenses for my project dependencies so I won't be sued if I depend on those libraries?
  3. Is there a difference between depending on a library (without including its code into my project, only use build artefacts) vs copying the code from other libraries?
  4. Does this license protect my project from copying by a big corporation and selling the product under their name?
  5. What people must do if they want to fork my project, change the code and use the modified version in their projects?
  6. Should I put a copyright notice in each file or having a single top-level file is fine?

Some similar questions are probably already answered here, but they answered for different licenses (like Apache-2.0). I would like to have a more understandable explanation about MPL-2.0 pros and cons in one place.

1 Answer 1

20
  1. Am I allowed to distribute the project for money under this license?

Yes. However, if you distribute/sell binaries, then you may not charge extra for the source code.
And, as the MPL license is a weak copyleft license, you are giving the users of your library also the right to distribute it further, which means that selling copies of the software is not sensible from an economics viewpoint.

  1. What are permitted licenses for my project dependencies so I won't be sued if I depend on those libraries?

The MPL license is a copyleft license, which means that in principle people are not allowed to distribute code that is under the MPL-2.0 license under different terms.
The GPL licenses (including LGPL and AGPL) require that the entire application is distributed under the terms of the GPL license. In principle, this is incompatible with the MPL license, but the MPL-2.0 license has a special exception for allowing the code to be distributed under the terms of the GPL licenses. However, an author can also choose to explicitly disable that exception.

From a legal standpoint, this means that any license is permissible, but the GPL license can be problematic if your project contains/depends on code under the MPL-1.3 license or the MPL-2.0 license that is marked as "Incompatible with Secondary Licenses".

From a practical standpoint, if you depend on GPL code, you should seriously consider using the GPL for your code as well.

  1. Is there a difference between depending on a library (without including its code into my project, only use build artefacts) vs copying the code from other libraries?

That depends on the licenses involved and if the copied code ends up in the same source files as your MPL licensed code.

In general, it is better, and legally clearer, to depend on an external library than to copy its code into your project.

  1. Does this license protect my project from copying by a big corporation and selling the product under their name?

No, but if they sell the product, they must provide access to the source code under the MPL-2.0 license. If they don't, that is a violation of the license terms under which they received the software and that would make them liable for copyright infringement claims.

  1. What people must do if they want to fork my project, change the code and use the modified version in their projects?

People must make it clear that (parts of) the project are licensed under the MPL-2.0 license and where the source code for those parts can be obtained.
People must not charge money (above the costs they make for the distribution) for obtaining the source code that corresponds to a distributed binary.

  1. Should I put a copyright notice in each file or having a single top-level file is fine?

Yes, you should put a copyright notice in each file, along with this statement

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/.

However, you don't need to put the notice in each file if it is "not possible or desirable" as per the license (Exhibit A):

"If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.