Migrate indexer logging from Maven Log to SLF4J#143
Merged
Conversation
SourceFileIndexer, PackageIndexer, ProjectIndexer, and
AiFieldGenerationSupport now log via org.slf4j.Logger instead of a
constructor-injected Maven Log, closing the long-standing "no SLF4J
usage" gap and decoupling these classes from the Maven Plugin API as
the first step toward extracting them into a standalone library. Only
the 5 mojos still touch org.apache.maven, enforced by a broadened
ArchUnit rule (nonMojoIsMavenFree) plus a new loggersArePrivateStaticFinal
rule.
All log calls use parameterized {} placeholders instead of string
concatenation, fixing a genuine SpotBugs LO_APPENDED_STRING_IN_FORMAT_STRING
finding; a narrowly-scoped CRLF_INJECTION_LOGS suppression was added for
the four converted classes (local filesystem paths only, no untrusted
input, matching the project's existing suppression style).
AiFieldGenerationSupportTest's log-capturing tests now attach a logback
ListAppender to the class logger instead of a hand-rolled Maven
SystemStreamLog subclass; logback-classic is added as a direct
test-scope dependency (already resolved transitively via llama) and
slf4j-api becomes a direct compile dependency.
Verified: full test suite green (414 tests, 3 expected native-model
skips), spotless/spotbugs clean, and an end-to-end run of the generate
goal against a scratch project confirms the SLF4J log lines surface
identically as [INFO] lines in Maven's console output via
maven-slf4j-provider.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016DByQrKSWzzpBt4iSRcmRP
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 11:22 — with
GitHub Actions
Failure
bernardladenthin
temporarily deployed
to
startgate
July 15, 2026 11:22 — with
GitHub Actions
Inactive
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 11:22 — with
GitHub Actions
Failure
PackageIndexer and ProjectIndexer each hardcoded their own private "1970-01-01T00:00:00Z" literal as the seed value for folding over child dates to find the latest one. Both are exactly Instant.EPOCH formatted through the same ISO_INSTANT formatter AiTimeSupport.formatInstant already uses for every other timestamp in a .ai.md header, so the duplicate literals are now a single derived AiTimeSupport.EPOCH_DATE constant. Added AiTimeSupportTest (previously untested despite being in the PIT 100%-threshold targetClasses list) to cover formatInstant and pin the new constant; verified 1/1 mutations killed on AiTimeSupport. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016DByQrKSWzzpBt4iSRcmRP
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 11:27 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 11:27 — with
GitHub Actions
Failure
bernardladenthin
temporarily deployed
to
startgate
July 15, 2026 11:27 — with
GitHub Actions
Inactive
|
Coverage Report for CI Build 29413473672Warning No base build found for commit Coverage: 73.156%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
Introduces the root net.ladenthin:srcmorph-parent (packaging=pom) as the first step of the srcmorph multi-module migration. The existing plugin moves into llamacpp-ai-index-maven-plugin/ with its coordinates, Java package, and goalPrefix completely unchanged — this step is a pure structural move, not a rename. The coordinate/package/goalPrefix rename to srcmorph is deferred to the final migration step, once the core library and CLI modules exist and the whole reactor is proven working end-to-end. Hoisted to the parent (reactor-wide, so future core/CLI modules can share it without duplication): project metadata (licenses, developers, scm, issueManagement, url, distributionManagement), the slf4j-api/ logback-classic dependencyManagement convergence pins, and the `release` profile (GPG signing + central-publishing-maven-plugin) so a single `mvn -P release deploy` from the root signs and publishes every reactor module. Everything else (dependencies, the full build-plugin chain, all other profiles) stays in the plugin module unchanged. Version bumped 1.0.3-SNAPSHOT -> 1.1.0-SNAPSHOT (parent + child, by inheritance) since adding modules is a feature-level change. Moved with git mv (history preserved): pom.xml, src/, and spotbugs-exclude.xml into llamacpp-ai-index-maven-plugin/ (spotbugs resolves its exclude file relative to the module basedir; lombok.config stays at the repo root, since Lombok's config search bubbles up from each source file until it finds one, and stopBubbling only stops the search at the file where it's declared — one shared root config already works correctly for every future module). Updated the path-relative references that break under the move: .gitignore module-scoped patterns, REUSE.toml file annotations, and every target/... path in .github/workflows/publish.yml (build artifacts, jacoco/PIT/vmlens reports, crash dumps, signed-artifact collection). Verified: `mvn verify` from the reactor root — BUILD SUCCESS, both modules green, 417 tests (3 expected native-model skips), spotless and spotbugs clean via their verify-phase bindings. Byte-diffed the generated plugin.xml descriptor against a pre-move build of the same commit: identical except the version number, confirming the mojo/ parameter/goalPrefix descriptor is completely unaffected by the restructuring. `mvn -P release help:effective-pom` confirms the parent's release profile (gpg + central-publishing) correctly resolves into the child module's effective build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016DByQrKSWzzpBt4iSRcmRP
bernardladenthin
temporarily deployed
to
startgate
July 15, 2026 11:57 — with
GitHub Actions
Inactive
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 11:57 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
maven-central
July 15, 2026 11:57 — with
GitHub Actions
Failure
11 tasks
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.



Summary
Logdependency with SLF4JLoggerin four indexer classes (AiFieldGenerationSupport,SourceFileIndexer,PackageIndexer,ProjectIndexer) to decouple them from the Maven plugin APILogconstructor parameters from indexer classes; loggers are now static final fieldsListAppenderinstead of a custom Maven Log wrapperslf4j-apicompile dependency andlogback-classictest dependency topom.xmlRationale
The indexer layer (orchestration, field generation, document handling, prompts, providers, config) is now framework-free and can be extracted into a standalone library without a Maven runtime. Only the
mojolayer remains the Maven Plugin API boundary. This change:Loginterface, making the code testable and reusable outside a Maven contextTest plan
AiFieldGenerationSupportTest,ProjectIndexerTest,PackageIndexerTest,SourceFileIndexerTestall updated to use logbackListAppenderand passPluginArchitectureTestnow enforces SLF4J logger field constraints and documents the Maven-free designRelated issues / PRs
None
Checklist
CONTRIBUTING.mdandCODE_OF_CONDUCT.mdhttps://claude.ai/code/session_016DByQrKSWzzpBt4iSRcmRP