Repository navigation
build: add license-header check to the build (#343) - #345
Merged
AndreasIgel merged 7 commits intoOct 12, 2026
Merged
AndreasIgel merged 7 commits into
AndreasIgel merged 7 commits into
Conversation
Adds com.mycila:license-maven-plugin (5.1.2) with a single check execution, wired per module like PrimeFaces. Header text lives in conf/header.txt; a COPYRIGHT_LINE header section accepts the existing copyright-year variants (2025, 2025-2026, without "(c)") while new files get the canonical line via license:format. Includes cover src/main/java/** and src/test/java/** per module; the generated example-builder tree and target/ are excluded. Missing or corrupted headers (including two files carrying Apache 2.0 headers) were normalized by license:format.
LICENSE.txt is byte-identical to the header text, so point the plugin at it and drop conf/header.txt. The header-section key is the literal copyright line itself, keeping per-file year variants valid.
…#343) The merged java-helpers#312 files carry a shortened variant of the MIT text; the new license check flagged them in CI. license:format rewrites them to the canonical header.
…ers#343) The module is activated only by the performance-test profile and has no committed Java sources; its DTOs are generated into src/main/java/.../ performance_test/library/** by generate_classes.py and builder output lands in generated-performance-builder/. Both generated roots are excluded so generated files are never flagged.
…ava-helpers#343) The module only enters the reactor under the performance-test profile, which CI never enables. A dedicated license:check step with the profile active covers it without building the module.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ction config (java-helpers#343) - normalize all source headers and LICENSE.txt to Copyright (c) 2025-2026 - remove headerSections from all pom.xmls: strict literal match against LICENSE.txt enforces the uniform range; the loose ensureMatch regex and 2026 defaultValue would have let or written stale years - delete accidentally added empty .mvn/maven.config
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Implements #343.
Adds
com.mycila:license-maven-plugin5.1.2 with a singlecheckexecution, like PrimeFaces does it. The plugin is declared per module (core,processor,example,example-custom-generator,performance-test) and once at the root somvn license:check/mvn license:formatresolve cleanly when invoked from the repository root (the root aggregator checks 0 files; modules check their ownsrc/).LICENSE.txtis the header source — no separate header file needed, since its content is byte-identical to the header comment every file carries.Copyright (c) 2025-2026 Andreas Igelrange inLICENSE.txtand all 236 source files (project inception January 2025). Because every file carries the identical line, the strict literal match is the right enforcement — the earlierheaderSectionsconfig (looseensureMatchregex,2026defaultValue) was removed from all POMs: it would have tolerated stale years and written2026into new files vialicense:format.licenseSetincludessrc/main/java/**andsrc/test/java/**per module; excludesgenerated-example-builder/**andtarget/**.performance-test(profile-gated, not part of the default build) additionally excludes its generated roots: the DTO treesrc/main/java/.../performance_test/library/**produced bygenerate_classes.py, and the annotation-processor outputgenerated-performance-builder/**. The pipeline runsmvn -B license:check -Pperformance-testas a separate step so this module is checked in CI without being built.mvn license:check/mvn license:formatsection added under Code Style indocs/CONTRIBUTING.md.license:formatwas run: it added the header to the files that were missing it and normalized headers with corrupted license text (FormattingMode,LibraryHelperDto,PackageScopesTest,FormattingModeTest). Two files (ResolvedBuilder,BuilderInstantiation) carried Apache 2.0 headers — they now have the project-wide MIT header like every other file. After merging #312, the check also normalized nine MapStruct SPI files whose headers carried a shortened variant of the license text (e.g.MapStructBuilderProvider,SimpleBuildersSpiIntegration,PersonDtoMapper). The uniform-range update normalized the remaining variants (Copyright (c) 2025 Andreas IgelinBuilderProcessorTest,MethodConflictResolutionTest, and all2026-only headers) to2025-2026.Verified:
mvn -B install -Pmetricspasses with the check bound intoverify(232 files checked, 0 missing);mvn -Pperformance-test license:checkruns on all 6 reactor projects; a source file without a header fails the build, while a headerless file under the generatedperformance_test/librarytree passes as intended.Written by Devin