Skip to content

Conversation

@mingyen066
Copy link
Collaborator

@mingyen066 mingyen066 commented Nov 4, 2025

Typo in license header sometimes can be found like #20800. As discussed
here, add a Gradle task to verify ASF license header in JSON files under
src/main/resources

If a JSON file’s header does not match gradle/LICENSE.json, the task
will fail.
For example:

❯ ./gradlew clean build -x test
...
> Task :clients:checkJsonLicenseHeader FAILED

 clients: Incorrect ASF license header in JSON files:

 -
/Users/ming/code/kafka/clients/src/main/resources/common/message/AddOffsetsToTxnRequest.json

[Incubating] Problems report is available at:
file:///Users/ming/code/kafka/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/ming/code/kafka/build.gradle' line: 895

* What went wrong:
Execution failed for task ':clients:checkJsonLicenseHeader'.
> Project 'clients' has 1 JSON files with incorrect ASF license header.
...

@github-actions github-actions bot added triage PRs from the community build Gradle build or GitHub Actions small Small PRs labels Nov 4, 2025
Copy link
Collaborator

@m1a2st m1a2st left a comment

Choose a reason for hiding this comment

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

It seems that when running the command ./gradlew clean build -x test, the checkJsonLicenseHeader task is not executed.

@mingyen066
Copy link
Collaborator Author

mingyen066 commented Nov 5, 2025

It seems that when running the command ./gradlew clean build -x test, the checkJsonLicenseHeader task is not executed.

@m1a2st Thanks for catching this.
Updated to use check.dependsOn("checkJsonLicenseHeader") to fix it.

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

Labels

build Gradle build or GitHub Actions small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants