To read more about the reasons for this distinction, please see this article by the FSF. SPDX-License-Identifier: GPL-2.0-or-later
Instead, always use either the suffix “ -only“ or the suffix “ -or-later“ with GNU licenses.įor example, the following expression allows recipients to use the file under the GPL v2.0 only:īy contrast, the following expression allows recipients to use the file under the GPL v2.0, or any later version of the GPL published by the FSF: SPDX-License-Identifier: AFL-2.0+ GNU licensesįor GNU licenses, do not use just the bare license ID, such as “GPL-2.0”.
Non-GNU licensesįor non-GNU licenses, just add the + operator to the end of the license.įor example, the following expression allows recipients to use the file under the Academic Free License v2.0, or any future version of that license:
How to express this depends on whether it is a non-GNU license or a GNU license (such as the GPL, LGPL, AGPL and GFDL). Some licensors will permit licensees to use the specified version of a license, or any later version of that license. If you’re looking for more details on how IDs work, see below.
Using expressions like these in your source code and documentation is enough to get started. The licensee may also optionally apply the Classpath exception, version 2.0. SPDX-License-Identifier: GPL-3.0-only WITH Classpath-exception-2.0 The file is subject to version 3.0 only of the GPL. Whichever they choose, they must comply with both that license and Apache-2.0. The licensee may choose between MIT and GPL-2.0. SPDX-License-Identifier: Apache-2.0 AND (MIT OR GPL-2.0-only) The file is subject to both the Apache-2.0 license, and at the licensee’s choice either the MIT license or version 2.0 only of the GPL. The licensee must comply with both licenses when using the file. SPDX-License-Identifier: Apache-2.0 AND MIT The file is subject to both the Apache-2.0 license and the MIT license. SPDX-License-Identifier: Apache-2.0 OR MIT The licensee may choose to use the file under either the Apache-2.0 license or the MIT license. SPDX-License-Identifier: GPL-2.0-or-later The file is under the GNU General Public License version 2.0, or any later version, at the licensee’s option.Ī special suffix style is used for GNU licenses see below for details. SPDX-License-Identifier: GPL-2.0-only The file is under the GNU General Public License version 2.0.Ī special suffix style is used for GNU licenses see below for details. SPDX-License-Identifier: EPL-1.0+ The file is under the Eclipse Public License version 1.0, or any later version, at the licensee’s option. SPDX-License-Identifier: MIT The file is under the MIT license. Saying “ MPL-2.0 AND MIT“ or “ MPL-2.0 OR MIT“ specifies precisely whether the licensee must comply with both licenses, orĮither license, when redistributing the file. Saying “this file is MPL/MIT” is ambiguous, and leaves recipients unclear about their compliance requirements. Using SPDX IDs helps convey the meaning of license combinations more specifically and accurately, so that recipients can trust they are complying with your license. SPDX IDs reduce license errors and risks.
You can start adding SPDX IDs to new files without changing anything already present in your codebase. An SPDX ID is located within each source code or documentation file, and follows that file into downstream projects, making license compliance easier. Downstream recipients may not know what license applies when a file leaves your repo. If your project only has license info in a top-level LICENSE.txt file, it can be harder for others to reuse your code. Gathering license information across your project files can start to become as easy as running grep. SPDX IDs are human-readable and machine-readable. Saying “ BSD-3-Clause ” means one specific license. Saying “a BSD-style license” can mean a wide range of different licenses, some with quite different requirements. They’re based on the SPDX License List, a curated set of licenses which helps make sure we’re all talking about the same thing. If you can write a comment in a source code file, you can add an SPDX ID.Īdding an SPDX ID only requires adding a single SPDX-License-Identifier: line. SPDX short-form identifiers make it easier to talk about FOSS licensing.