1

MIT license states

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

If I make a modified version of an MIT-covered code and publish it, does it have to be under an MIT license because the notice is copied?

5

Code that you write does not need to be licensed under the MIT license. The original code that you received under the MIT license must remain under the MIT license. (Or, maybe not -- but this is certainly true for most licenses, which do not include "sublicense" as a permission. The ambiguous "sublicense" permission complicates this; see Does the MIT license's right to "sublicense" allow me to change the license of someone else's work?.)

So, you must preserve the MIT license and copyright notice as long as you have someone else's MIT-licensed work in your project. Fortunately, the MIT license is very permissive, so it does not stop you from licensing your code (or someone else's differently-licensed code) under other terms alongside the MIT-licensed code, as long as those other terms do not positively conflict with the requirement to display the notice. There are no popular software licenses that would cause such a conflict; such a license would need to have absurdly extreme terms like, "When including this software in a derived work, you must not display notices for any other software included alongside this software." The one category of license I can think of that would cause a conflict is any Creative Commons license with a "No Derivatives" provision, which disallows combining a work with anything else (but that license is explicitly not intended for use with software).

For the sake of clarity, you should clearly indicate in a README which components are MIT-licensed and which are not. The terms of the MIT license don't explicitly require this (unlike, e.g., the Apache license), but if you don't do this, then recipients of the code will not know which parts are covered under which license.

  • What if you modified the original code? Do your modifications fall under the MIT license? Or do you just indicate where the code came from? – Jean-Luc Nacif Coelho Mar 10 '16 at 18:59
  • 2
    @Jean-LucNacifCoelho, your modifications are your own. Under MIT you can e.g. change something, and just distribute binaries (as long as you state it contains MIT licensed code, e.g. in the documentation). – vonbrand Mar 10 '16 at 19:27
  • @Jean-LucNacifCoelho vonbrand has it right. When I say "your code" in this answer, that could include either new files or changes to existing files. A modification to a file or existing lines of code can make it difficult to indicate exactly which parts are under which license, but since the MIT is very permissive, people often just handle the whole file as if it were under the most restrictive license that its parts are licensed under and preserve the MIT notice. – apsillers Mar 10 '16 at 19:58
  • 1
    MIT license permits sub-licensing. – RubberDuck Mar 11 '16 at 1:08
  • @RubberDuck I assumed "sublicense" was distinct from "relicensing" and meant you can issue the license (as-is) to other people. Notably, even if we interpret "sublicense" to include "relicense," you can't practically remove the MIT license from the software, because you can't lexically remove the text of the license, as doing so would violate the reproduction requirement. There do not appear to be a great deal of information about what "sublicense" means in the context of the MIT license online. – apsillers Mar 11 '16 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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