Skip to content

Resolve relative file URLs of license texts against the basedir - #809

Merged
slachiewicz merged 1 commit into
masterfrom
agent/file-url-license-texts
Nov 8, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/file-url-license-texts

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

A file: license URL such as file:licenses/a.html, file://licenses/a.html or file://./licenses/a.html is now resolved against the project basedir, which the mojo passes to LicenseDownloader; before, only absolute paths worked and the others failed with a URI error or an NPE. The copy takes its extension from the source file name, with .txt as the fallback, the way an HTTP download takes it from the content type, and a preferred file name is kept. The download-licenses example page has a section on file: URLs.

Closes #428
Closes #431

Verified: mvn verify -Prun-its -Dinvoker.test=download-licenses-file-url → fails before (NPE), passes after; mvn test -Dtest='LicenseDownloader*Test' → 45 tests pass

@slachiewicz slachiewicz added the bug Something isn't working label Nov 8, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 8, 2026 22:47
@slachiewicz
slachiewicz merged commit 52e7f2f into master Nov 8, 2026
15 checks passed
@slachiewicz
slachiewicz deleted the agent/file-url-license-texts branch November 8, 2026 22:48
@github-actions github-actions Bot added this to the 2.8.1 milestone Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

1 participant