Skip to content

Send a plugin-specific User-Agent when downloading licenses - #728

Merged
slachiewicz merged 1 commit into
masterfrom
license-downloader-user-agent
Aug 24, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
license-downloader-user-agent

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

gnu.org answers the Apache HttpClient default user agent with 429 Too Many Requests on the very first request, so download-licenses never retrieves a license from one of the most frequently referenced hosts. The plugin now identifies itself as license-maven-plugin/<version>, taken from the jar manifest Implementation-Version.

Extracted from #622, where @Master-Code-Programmer diagnosed the cause. That PR sends Wget/1.21.4; it also adds an https:// and then plaintext http:// retry for protocol-less license URLs, which is a separate behaviour change and stays out of this PR.

Verified: mvn verify -Prun-its -Dinvoker.test=download-licenses-auth passes, and reverting only the LicenseDownloader change fails the new assertion with User-Agent: Apache-HttpClient/4.5.14 (Java/25.0.4).

This change was created with AI assistance.

gnu.org answers the Apache HttpClient default user agent with
"429 Too Many Requests" on the very first request, so downloads from one
of the most frequently referenced license hosts never succeed.

Co-authored-by: Jan-Hendrik Diederich <1955253+Master-Code-Programmer@users.noreply.github.com>
@slachiewicz slachiewicz added bug Something isn't working download-licenses labels Aug 23, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review August 23, 2026 09:02
@slachiewicz
slachiewicz merged commit 859aa31 into master Aug 24, 2026
20 checks passed
@slachiewicz
slachiewicz deleted the license-downloader-user-agent branch August 24, 2026 14:26
@github-actions github-actions Bot added this to the 2.7.2 milestone Aug 24, 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 download-licenses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant