feat: align Maven connector with Gradle parity#96
Conversation
What: - Add build-tool connector capability catalog and parity documentation in AGENTS.md, QUALITY.md, and README.md. - Extend Gradle and Maven connector mappings for excludes, test source roots, Analysis Store artifacts, Joern semantic enrichment, cleanup, and reactor aggregation. - Add shared semantic enrichment orchestration for build-tool-neutral Joern import behavior. Why: - Maven needed the same forensic analysis capabilities exposed by the Gradle connector. - The quality gate now documents and verifies connector parity explicitly. Changes: - Update GenerationRequest and GenerateRulesUseCase to support exclude package prefixes. - Extend BtmGenExtension, GenerateBtmTask, BtmGenMojo, and MavenBtmGenParameters mapping. - Add Maven goals for btmgen-aggregate, analyze, analyze-aggregate, analyze-semantics, import-semantics, and clean-analysis. - Move Gradle semantic analysis task orchestration onto the shared SemanticEnrichmentRunner. - Add Maven reactor source-root collection with deterministic root ordering. - Add parity, Maven Analysis Store, Joern configuration, reactor aggregation, and coverage-focused tests. Impact: - New Maven connector features are behavior-relevant and align Maven output with Gradle under target/forensics. - Existing Gradle defaults remain compatible while adding excludes and includeTests configuration. - Dependency-aware scan-cache invalidation now conservatively rebuilds the H2 cache instead of failing. Testing: - .\\gradlew.bat test --dependency-verification strict --console=plain --stacktrace - .\\gradlew.bat clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --dependency-verification strict --console=plain --stacktrace - .\\gradlew.bat validatePlugins --dependency-verification strict --no-daemon --console=plain --stacktrace - .\\gradlew.bat test --tests '*BtmGenerationAdapterValidationTest' --tests '*BuildToolConnectorParityTest' --tests '*MavenReactorAggregationTest' --tests '*HexagonRulesTest' --dependency-verification strict --console=plain --stacktrace
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66b450ccd0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cacheDatabaseFile, | ||
| analysisStoreEnabled, | ||
| analysisStoreDirectory, | ||
| cleanupPolicy, |
There was a problem hiding this comment.
Ignore cleanup policy during combined analyze flow
Passing the user-supplied cleanupPolicy into forensics:analyze lets DELETE_ON_SUCCESS remove the analysis store immediately after BTM generation, before semantic enrichment starts. In that configuration (joernEnabled=true and cleanupPolicy=DELETE_ON_SUCCESS), SemanticEnrichmentRunner runs against a fresh H2 store that no longer contains the original analysis_run, so semantic import/checksum writes can fail with FK/consistency errors after Joern work has already completed. The combined analyze goals should force keep-on-success behavior (or defer cleanup until enrichment finishes).
Useful? React with 👍 / 👎.
What: - Extract shared Maven BTM parameter mapping into common Mojo base classes. - Keep combined Maven analyze goals from deleting the Analysis Store before semantic enrichment. - Centralize repeated Maven test setup for project, session, source, log, and reflection helpers. Why: - SonarCloud reported excessive new-code duplication on PR #96. - The combined analyze flow must keep generated Analysis Store content available for Joern import. Changes: - Add AbstractBtmGenerationMojo and AbstractAggregateBtmGenerationMojo for shared Maven parameters and reactor roots. - Refactor BtmGenMojo, BtmGenAggregateMojo, AnalyzeMojo, and AnalyzeAggregateMojo onto the shared mapping. - Add shared analysis-store validation support and cleanup-policy regression coverage. - Update Maven parity tests to handle inherited Mojo fields. Impact: - Fixes behavior where forensics:analyze and forensics:analyze-aggregate could honor DELETE_ON_SUCCESS before semantic enrichment. - No public Gradle or Maven goal names were changed. - No dependency, Java, Gradle, JaCoCo, or Sonar configuration changes were introduced. Testing: - .\gradlew.bat test --tests '*MavenAnalysisGoalsTest' --tests '*MavenReactorAggregationTest' --tests '*MavenBtmGenParametersTest' --tests '*BtmGenMojoTest' --tests '*MavenAnalysisStoreParityTest' --tests '*MavenJoernConfigurationParityTest' --dependency-verification strict --console=plain --stacktrace - .\gradlew.bat test --tests '*BtmGenerationAdapterValidationTest' --dependency-verification strict --console=plain --stacktrace - .\gradlew.bat clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --dependency-verification strict --console=plain --stacktrace - .\gradlew.bat validatePlugins --dependency-verification strict --no-daemon --console=plain --stacktrace - .\gradlew.bat test --tests '*BtmGenerationAdapterValidationTest' --tests '*BuildToolConnectorParityTest' --tests '*MavenReactorAggregationTest' --tests '*HexagonRulesTest' --dependency-verification strict --console=plain --stacktrace - .\gradlew.bat test --dependency-verification strict --console=plain --stacktrace - .\gradlew.bat generateMavenPluginDescriptor --dependency-verification strict --console=plain --stacktrace
|


What:
Why:
Changes:
Impact:
Testing: