Skip to main content
SourceTrustSign in

Help center

Guides for SourceTrust: Importing dependencies, reviewing licenses, external obligations, publishing attestation pages, billing, plain-language license explainers, and procurement-oriented explainers for common open-source licenses.

License exceptions (WITH expressions)

← All articles

An exception loosens a license, never tightens it. GPL-2.0-only WITH Classpath-exception-2.0 is the GPL without the linking problem.

What this license is

An exception is a rider that the copyright holders attach to a base license to remove one of its restrictions. It can only give you more room, never less. Four of them cover almost everything you will meet. Classpath-exception-2.0 on GPL-2.0-only is the OpenJDK license: you may link your own code against the class library without your code becoming GPL. LLVM-exception on Apache-2.0 covers the LLVM toolchain and Rust's compiler-builtins crate. GCC-exception-3.1 does the same job for code that GCC emits, and Autoconf-exception covers generated configure scripts.

Why it matters for your product

If you see GPL-2.0-only WITH Classpath-exception-2.0 on a JDK dependency, the practical answer is that it does not make your application GPL. That is the entire reason the exception exists. It is worth saying plainly, because a bare GPL label on a JDK frightens people who have been told to avoid the GPL. The same goes for code built on LLVM and for anything compiled with GCC. The risk runs the other way: drop the exception from your records, and a routine dependency starts reading as a strong copyleft problem it is not.

You are meeting the terms when

  • You record the full expression, base and exception together. Dropping the exception overstates your duties, and dropping the base understates them.
  • You rely on the exception only as far as its own text reaches. The base license still governs everything the exception does not touch.
  • You do not carry an exception from one project onto another project's code. It is granted by that project's copyright holders, for that project.
  • You have checked that your SBOM output still carries the WITH clause. An export that says GPL-2.0-only alone turns a harmless JDK dependency into a red flag in someone else's review.

Where teams get it wrong

  • An SBOM records GPL-2.0-only and drops WITH Classpath-exception-2.0. A routine JDK dependency then reads as a strong copyleft problem it is not.
  • Someone assumes an exception can add a restriction. It cannot. Text that adds a condition is a modification of the license, not an exception to it.
  • Someone treats any text appended after a license as an exception. An unrecognised addition is a modification, and it changes the terms you are working under.

How SourceTrust handles this license

The expression parser treats WITH as a first-class operator, so GPL-2.0-only WITH Classpath-exception-2.0 is kept whole rather than reduced to its base. The text arbiter is taught that a recognised exception appended to a base license is a standard WITH construction and not a package modification. It names Classpath-exception-2.0, LLVM-exception, GCC-exception-3.1 and Autoconf-exception-3.0 explicitly. Any compound expression containing a WITH is classified as unsafe, so it is never flattened and always reaches a person. Read Auto-fetch license text.

  • The base license still drives the checklist. A GPL base is copyleft, so a source offer item appears on projects that ship binaries or run a mixed deployment.
  • The text stored on the component is what your attestation page and export files carry. Attach the copy that includes the exception, not a bare base license.

Related guides

Practical guidance for procurement review, not legal advice. Confirm high-stakes use with counsel.

Handle this license in SourceTrust

A dropped WITH clause turns an ordinary JDK dependency into a copyleft alarm in somebody else's review. SourceTrust keeps the whole expression and the matching text on the component, all the way into the files you export.

Importing, reviewing and drafting are free. Your first public attestation page is free too: one lifetime Community page per organization, plus open-source projects connected to a public GitHub repository (up to 10 activations a calendar month).

Free pages carry SourceTrust attribution and stay open to search engines. Paid plans start at $29 per active project a month and remove the attribution.

Use code LICENSEGUIDE at checkout for 90% off your first 3 months on the monthly plan.

See what is free and what is paid