Skip to content

build: remove redundant license download step to speed up distribution building - #19853

Open
FrankChen021 wants to merge 1 commit into
apache:masterfrom
FrankChen021:codex/remove-license-download
Open

build: remove redundant license download step to speed up distribution building#19853
FrankChen021 wants to merge 1 commit into
apache:masterfrom
FrankChen021:codex/remove-license-download

Conversation

@FrankChen021

Copy link
Copy Markdown
Member

Summary

  • Remove the legacy license-maven-plugin from the dist profile.
  • Keep Druid's existing licenses.yaml-based license and notice generation unchanged.

Motivation

The distribution build currently invokes the plugin's download-licenses goal:

[INFO] --- license:2.7.1:download-licenses (download-licenses) @ distribution ---

This goal reads license URLs from dependency POMs and attempts to download them. During distribution builds, it produces numerous warnings for missing or unreachable URLs, including:

[WARNING] No URL for license at index 0 in dependency aopalliance:aopalliance:1.0
[WARNING] No URL for license at index 0 in dependency org.tukaani:xz:1.9
[WARNING] Unable to retrieve license from URL 'http://glassfish.java.net/public/CDDL+GPL_1_1.html' for dependency 'com.sun.jersey:jersey-core:1.19.4': Connect timed out
[WARNING] Unable to retrieve license from URL 'https://www.gnu.org/software/classpath/license.html' for dependency 'jakarta.transaction:jakarta.transaction-api:1.3.3': No route to host
[WARNING] Unable to retrieve license from URL 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1' for dependency 'net.java.dev.jna:jna:5.18.1': No route to host
[WARNING] There were 15 download errors - check the warnings above

The generated files under target/generated-resources are not consumed by the distribution assembly. The download phase takes approximately one minute and delays the build while waiting for network timeouts.

In the reported build, removing the plugin reduced the distribution module time by approximately 1 minute and 10 seconds:

Configuration Distribution module time
With download-licenses 02:11
Without download-licenses 01:01

This change therefore eliminates the warnings and significantly reduces distribution build time.

Why this is safe

The legacy license-maven-plugin was introduced in the original distribution packaging in 2015, before PR numbers were consistently recorded in the repository.

The distribution assembly packages LICENSE.BINARY as LICENSE, NOTICE.BINARY as NOTICE, and the curated licenses/** files. It does not package the plugin's target/generated-resources output.

Therefore, this change removes only an obsolete network-download step. The shipped license files and Apache release license validation remain unchanged.

Verification

  • Ran mvn -o -pl distribution -Pdist validate -DskipTests -Dweb.console.skip=true -Pskip-static-checks successfully.
  • Validated the effective dist POM.
  • Confirmed the binary license and notice generators remain configured.
  • Confirmed license-maven-plugin and download-licenses are no longer present.
  • Confirmed the change has no whitespace errors with git diff --check.

@FrankChen021
FrankChen021 marked this pull request as ready for review August 2, 2026 08:15
Copilot AI review requested due to automatic review settings August 2, 2026 08:15
@FrankChen021 FrankChen021 changed the title Remove redundant license download step Remove redundant license download step to speed up building Aug 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR speeds up distribution builds by removing the legacy license-maven-plugin execution that attempted to download dependency license texts during the dist profile build, while keeping Druid’s existing licenses.yaml-based license/notice generation workflow intact.

Changes:

  • Removed the org.codehaus.mojo:license-maven-plugin download-licenses execution from the dist profile in the distribution module POM.
  • Left the existing apache-release profile’s curated license report/check scripts and distribution assembly behavior unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@FrankChen021 FrankChen021 changed the title Remove redundant license download step to speed up building build: remove redundant license download step Aug 2, 2026
@FrankChen021 FrankChen021 changed the title build: remove redundant license download step build: remove redundant license download step to speed up distribution building Aug 2, 2026

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the code for correctness, edge cases, build lifecycle, and integration risks; no issues found.

Reviewed 1 of 1 changed files.


This is an automated review by Codex GPT-5.6-Sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants