Skip to content

Add license-header check to the build (like PrimeFaces) #343

Open

Description

@igel-devin-ai

Problem

There is no license-header check in the build. The MIT headers on source files are kept by convention only — nothing fails a build when a file ships without one (new source files, test fixtures, generated-tree stubs).

The only adjacent tooling today:

  • com.spotify.fmt:fmt-maven-plugin — google-java-format, formatting only, no headers.
  • dependency-review.yml — audits dependency licenses on PRs, not source headers.

Proposal

Add a license-header check like PrimeFaces does it (pom.xml):

  • com.mycila:license-maven-plugin (PrimeFaces uses 5.1.2) with a single check execution.
  • Header text in conf/header.txt (the existing MIT header every file already carries, minus per-file year/name where applicable).
  • licenseSet includes covering src/main/java/** and src/test/java/** per module; exclusions for generated sources (example/generated-example-builder, target/**) and resource files that don't need headers.

With the plugin bound to the default lifecycle, mvn verify/license:check then fails CI on any missing header, and mvn license:format fixes headers mechanically.

Surfaced while reviewing #312 (MapStruct integration).

Activity

  1. igel-devin-ai commented on Oct 11, 2026

    @igel-devin-ai
    CollaboratorAuthor

    Follow-up TODO from the license-header check introduced in #345:

    • Fix existing mismatches and missing license headers in checked paths (src/main/java/**, src/test/java/** of every module) — done in build: add license-header check to the build (#343) #345 via mvn license:format: 38 files got the header added, 4 files with corrupted license text were normalized, 2 files carrying Apache-2.0 headers now have the project-wide MIT header, and the 9 files merged with feat: auto-detect generated builders in MapStruct via BuilderProvider SPI (#300) #312 were normalized to the canonical header.
    • Generated sources — decided: stay excluded, no headers needed. example/generated-example-builder/**, and in performance-test the generated DTO tree (src/main/java/.../performance_test/library/**) plus processor output (generated-performance-builder/**) are all excluded from the check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions