I have created an open source library that is designed to be used by other open source projects; not by end users. Currently it is licensed as GPLv3.

My main goal is that every project that uses my library must be open sourced. For me personally it doesn’t matter if the other project that uses my library is licensed on e.g. Apache-2.0 or MIT as long the project used by the end-user is open sourced on e.g. GitHub.

Based on different licenses I see that:

  • LGPLv3 would not be the right choice as it allows to be linked by a proprietary software
  • GPLv3 seems be too strict for me, as enforces that other software needs to be licensed as GPLv3 as well. Furthermore, GPLv3 doesn’t allow to be used by a project which is licensed under Apache-2.0/MIT
  • Apache-2.0 and MIT licenses seems not be the option for me as they can be used by proprietary software directly

I could not find the right license for my purpose. Again, it is totally fine to use my library as long the end-user project/software itself is open source without enforcing that it needs to be licensed under GPLv3 as well? My main goal is to support the open source community only!

Am I alone with the idea? What is the best way to achieve? Which license would be most suitable for me?

  • 1
    The trouble with that is the "GPL condom" problem: I create a MIT library which does nothing other than proxy calls through to your library. I release the (minimal) code to my library. I can now use my MIT licensed library in any code I feel like without ever releasing the code to your library. Commented Jan 2, 2021 at 21:04
  • 6
    You want your code to be usable in projects under permissive licenses like Apache 2 and MIT. Those projects want to be usable in proprietary projects. Do you want your project to exist within an MIT-licensed project without stopping that MIT project from being included in a proprietary project? If you do not object to that, you want a permissive license. If you do object, you want your license to impose requirements on downstream projects that force source disclosure (i.e., you want a copyleft license like the GPL).
    – apsillers
    Commented Jan 2, 2021 at 21:38

2 Answers 2


There are two fundamentally different takes on open-source licenses:

  1. the permissive ones like MIT, Apache etc which - roughly speaking - don't care what happens to their sources as long as the credits are maintained and communicated.

  2. And there are the more strictly open source licenses, the copy-left licenses, which want to make sure that any derivative remains also open source, most notably the GPL license.

The license is usually chosen by the (initial) authors for a reason that s/he wants the first or the latter.

As such a license as you seek might be crafted, but serves little use: A permissively-licensed project would not want to make use of a license that can only be used in open-source projects; its license was chosen particularly such that proprietary use is possible.

A project already with a copy-left license does not need such a license either - it could as well use the GPL which ensures just that: be open source and stay open source.

As such, it might even be argued that a license that may be used only in an open-source project already exists: the GPL. Most open source licenses are compatible with the GPL in the sense that they may be used in a GPL-licensed project (by simply changing the license to GPL for the derived / combined software - even when notable exceptions exist like the incompatibility with Apache or MPL).


The only solution I see is to write an exception for GPLv3.

What is it about?

The GNU GPL allows you to add an exception that is a special permission for additional things. This is useful and used in some projects (some libraries from GCC, OpenJDK).The LGPL (version 3) itself is an exception to the GNU GPL.

You can write an exception that allows you to combine works statically and dynamically and distribute them under your own licenses, but only if the license is (1) Free (according to the Free Software or Open Source Definition) (2) Is incompatible with the GNU GPL 3 ( if it is compatible then the exception makes no sense).

Unfortunately, this has limitations:

  • If someone downloads a binary copy of your library from an application that uses it, he can reverse engineer it (your library is partly written in Java, which is relatively easy to decompile) and use the code under a different license. This can be prevented by forcing a special notice to be added to the license of such an application (e.g. "this program links the xyz library. Use of the xyz library is subject to the GPL"), but then it would be pointless if someone is copylefted and cannot legally add such a notice. However, looking at conditions (1) and (2), this would rather include CDDL or GPL derivatives or other rare Open Source licenses, and you shouldn't have a problem with someone using a code snippet of a decompiled library under another ideologically similar to GPL Open Source license.
  • If someone modifies your library, they can remove this exception and distribute under plain GPL.

Still, I think it's worth doing. So far, I don't have a ready-made template that you could use. If I find one or write one myself, I'll post it.

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.