Suppose you have top level Dependency A.

Dependency A is licensed under MIT.

Dependency A packages Dependency B as part of its distribution.

Dependency B is licensed under GPL.

In order to use Dependency A, do you need to agree to the terms of both MIT as well as GPL, or just MIT.

  • Does A depend on B (you can't use A without B), or are the two just distributed together for convenience? Jun 29, 2016 at 6:54
  • 1
    A Depends on B.
    – dardo
    Jun 29, 2016 at 12:18

1 Answer 1


The GPL license is written in such a way that you are not allowed to use GPL-licensed code in a product unless the users of the product have the same rights that are granted by applying the GPL license. This is even the case if only a small portion of the complete product is actually licensed under the GPL.
Due to this "infectious" nature of the GPL, if you indirectly/transitively depend on some code that is licensed under the GPL, then you are also required to release your project under a license that is compatible with the GPL.

So, if you want to use Dependency A (MIT licensed), which in turn depends on Dependency B (GPL licensed), then your code must be licensed in a way that is compatible with the terms of the GPL, which essentially means that you have to use an open-source license.

  • The doubt I have about this is - can a MIT-licensed dependency depend on a GPL-licensed transitive dependency? Or does the fact that my dependency is MIT-licensed guarantee that any transitive dependencies it has are also licensed permissively? Mar 10, 2020 at 8:03
  • @JiriTousek, Yes, even if you use a GPL dependency, you can place your own code under the MIT license. It is recommended, but not required, to inform your users about the GPL dependency and thus the effective license being GPL. Mar 10, 2020 at 8:25
  • Answers here seem to contradict that - if you use a GPL dependency, you have to use a similar copyleft license when distributing it - which MIT is not. Mar 10, 2020 at 8:33
  • @JiriTousek, there is a subtle difference between what most people think the GPL requires and what it actually states, but that goes too deep for a comment. If you want to know more about it, I recommend you post a new question about that topic. Mar 10, 2020 at 10:22

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.