Understanding Open Source Licenses: Types, Usage, and Selection Guide
This comprehensive guide explains what open source is, distinguishes permissive and copyleft licenses, details common licenses such as MIT, Apache‑2.0, GPL, LGPL, AGPL, and MPL, shows how to apply a license in a project, and highlights a Chinese GPL infringement case.
Open source licenses are essential for developers both creating and using open source software, helping avoid legal issues.
What is Open Source
Open source means the source code is publicly available, defined by the Open Source Initiative (OSI). The term “Free Software” refers to freedom, not price, and is the predecessor of open source software.
Open source software = open source code + open source license; code without a license is not truly open source.
Note: A public repository on GitHub without a license can still be viewed and forked by others under GitHub’s terms.
Open Source Licenses
Open source licenses (or “open source licenses”) declare the rights and obligations of authors and users. They are legally binding and OSI‑certified; over 110 licenses comply with the Open Source Definition (OSD).
Common licenses fall into two categories: Permissive (lenient) and Copyleft (restrictive).
Permissive Licenses
These impose few restrictions. Examples include:
BSD 2‑Clause – redistribution must retain the original license notice.
BSD 3‑Clause – same as 2‑Clause plus prohibition on using the author’s name for promotion.
MIT – allows use, copy, modify, merge, publish, distribute, sublicense, and sell, provided the original notice is retained.
Apache‑2.0 – requires preserving the license notice, noting modifications, and not altering the license in unchanged files.
Copyleft Licenses
Copyleft uses copyright to guarantee user freedom. It imposes more restrictions than permissive licenses.
Common copyleft licenses:
GPL – requires derivative works that are distributed to be released under the same license.
LGPL – similar to GPL but allows linking to libraries without open‑sourcing the entire program.
AGPL – extends GPL’s requirements to SaaS services, requiring source disclosure for cloud‑based use.
MPL‑2.0 – balances permissive and copyleft traits; allows new files to remain closed‑source while MPL‑covered files stay open.
Other notable licenses include the “Unlicense” (public domain dedication) and China’s OSI‑approved Mulan PSL2.
Using a License (Example: MIT)
Create a LICENSE file in the project root.
Copy the MIT license template from the OSI website.
Replace COPYRIGHT placeholders with the current year and your name.
Commit the LICENSE file to your repository; GitHub can auto‑populate it via “Choose a license”.
How to Choose a License
A popular diagram (originally by Paul Bagwell) categorises licenses from strict (left) to permissive (right), helping developers quickly select an appropriate license.
Creative Commons (CC) Licenses
For non‑software works such as tutorials or books, CC licenses are used instead of OSI licenses. They come in six main variants (e.g., CC BY 4.0, CC BY‑SA 4.0) and are internationally recognized.
Open‑Source Case Study
The first Chinese lawsuit for GPL violation involved VirtualApp, which switched from LGPL‑3.0 to GPL‑3.0 and was later found to have been infringed by “点心桌面”. The court awarded compensation, underscoring the importance of complying with license terms.
Conclusion
The article introduces open source concepts, common licenses, how to apply them, CC licenses for non‑software works, and a legal case, emphasizing that developers should understand and respect open source licenses.
Go Programming World
Mobile version of tech blog https://jianghushinian.cn/, covering Golang, Docker, Kubernetes and beyond.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.