Skip to content

Write well-known licenses from bundled texts instead of downloading them - #781

Merged
slachiewicz merged 2 commits into
masterfrom
agent/bundled-license-texts
Nov 6, 2026
Merged

slachiewicz merged 2 commits into
masterfrom
agent/bundled-license-texts

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Plain-text URLs of the GNU, Apache and Eclipse licenses are now written from the texts the plugin already ships in META-INF/licenses, with no request to the license host (#626). The table in bundled-license-urls.properties is curated: each URL was fetched once and compared with the bundled text.

  • license.useBundledLicenseTexts: text (default) serves exact .txt URLs (and Apache's extensionless LICENSE-2.0, which is served as text/plain); all also serves the HTML pages, whose file name, content and sha1 then change, so it is opt-in; none downloads everything as before.
  • Still downloaded: URLs whose licenseUrlFileNames sha1 the bundled text does not match, URLs under serverUrl with credentials, and anything after a licenseUrlReplacements rewrite to another host.
  • The bundled GPL 1.0/2.0, LGPL 2.1 and FDL 1.3 texts differ from the files gnu.org serves today only in the FSF postal address and URL lines; GPL 3.0, LGPL 3.0, AGPL 3.0, Apache 2.0 and EPL 2.0 are identical. MIT and BSD are not mapped, since the bundled versions are templates with copyright placeholders.

Verified: mvn -B verify -Prun-its β†’ 100 ITs pass, including two new ones that route the license hosts through WireMock and see no request for .txt URLs (one for the HTML URL unless all is set); 17 new unit tests.

Maps exact well-known license URLs to the texts the plugin already ships,
so that the download goals can answer them without a request.
Plain text URLs of the GNU, Apache and Eclipse licenses are served from the
plugin by default, which relieves the license hosts (#626). HTML page URLs
need license.useBundledLicenseTexts=all because the file name, content and
sha1 change. license.useBundledLicenseTexts=none restores downloading.
@slachiewicz slachiewicz added download-licenses enhancement New feature or request labels Nov 5, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 6, 2026 09:47
@slachiewicz
slachiewicz merged commit 49d6f10 into master Nov 6, 2026
15 checks passed
@slachiewicz
slachiewicz deleted the agent/bundled-license-texts branch November 6, 2026 09:49
@github-actions github-actions Bot added this to the 2.8.0 milestone Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

download-licenses enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant