This module provides a suite of advanced utilities and tools built on top of the Antikythera framework. It serves as both a showcase of the framework's capabilities and a production-ready toolkit for Java/Spring Boot code analysis, optimization, and migration.
- General Configuration
- Development Setup
- Maven Parent POM Converter
- Query Optimizer
- JPA Repository Analyzer
- Spring Boot Migration Tools
- Code Quality & Analysis Tools
- Knowledge Graph
Many tools in this project utilize a shared configuration format (typically generator.yml) to define project paths, AI service credentials, and other environment specifics.
variables:
projects_folder: ${HOME}/your-projects
m2_folder: ${HOME}/.m2/repository
base_path: ${projects_folder}/your-project/
ai_service:
provider: "gemini"
model: "gemini-2.5-flash-lite-preview-09-2025"
api_endpoint: "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent"
api_key: "${GEMINI_API_KEY}"
timeout_seconds: 90
max_retries: 2
track_usage: true
cost_per_1k_tokens: 0.00015Key Requirements:
base_path: Must point to the root of the project you are analyzing/modifying.GEMINI_API_KEY: Required for AI-powered features (Query Optimizer, Migrators).- Environment Variables: You can use
${VAR}syntax to reference environment variables.
If you want to extend these examples or debug the underlying Antikythera framework:
mvn clean compile
mvn testYou can link the local antikythera source code to this project for seamless debugging:
- Module Approach (Recommended): Import the
antikytheraproject as a module in the same IntelliJ window. IntelliJ will automatically use module dependencies. - Attach Sources: In "Project Structure > Libraries", find
sa.com.cloudsolutions:antikytheraand click "Attach Sources...", pointing to your localantikytherasource root.
A tool that converts Maven POMs with parent inheritance into completely standalone POMs by expanding all inherited configuration (<properties>, <dependencies>, <plugins>, <profiles>).
mvn exec:java -Dexec.mainClass="com.raditha.maven.PomFlattenerCLI"
# Run inside your project directory- ✅ Resolves parent POMs from local repository or relativePath
- ✅ Supports multi-level parent hierarchies
- ✅ Merges all inherited configurations
- ✅ Automatic timestamped backups
A comprehensive system for analyzing and optimizing Spring Data JPA repositories. It uses AI to optimize SQL/JPQL queries and an automated refactoring engine to apply those changes.
Analysis Only:
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.QueryOptimizationChecker"Optimization (Apply Changes):
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.QueryOptimizer"- AI-Powered Optimization: Uses LLMs to rewrite inefficient queries based on schema and cardinality.
- Liquibase Generation: Automatically generates changesets for missing indexes.
- Safe Refactoring: Updates
@Queryannotations and dependent method calls while preserving formatting.
Ensure your generator.yml is set up with valid AI service credentials and points to your project's base_path.
Bulk exports all JPA repository queries to CSV for auditing and analysis.
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.JPARepositoryAnalyzer" \
-Dexec.args="-b /path/to/project -o repository_queries.csv"- Extracts all
@Queryannotations from JPA repositories - Exports query metadata to CSV format
- Supports custom output file paths
- Analyzes both explicit queries and derived query methods
Automated tools to upgrade Spring Boot applications across major/minor versions.
Upgrades Spring Boot 2.1 apps to 2.2.
java -cp target/classes com.raditha.spring.SpringBoot21to22Migrator --project-path /path/to/projectUpgrades Spring Boot 2.2 apps to 2.3, handling validation changes, H2 console config, and more.
java -cp target/classes com.raditha.spring.SpringBoot22to23Migrator --project-path /path/to/projectUpgrades Spring Boot 2.3 apps to 2.4.
java -cp target/classes com.raditha.spring.SpringBoot23to24Migrator --project-path /path/to/projectUpgrades Spring Boot 2.4 apps to 2.5.
java -cp target/classes com.raditha.spring.SpringBoot24to25Migrator --project-path /path/to/projectDetects the Spring Boot version from a POM file.
java -cp target/classes sa.com.cloudsolutions.antikythera.examples.SpringBootVersionDetector /path/to/pom.xmlOutputs the detected Spring Boot version to stdout.
Detects and resolves circular bean dependencies using strategies like @Lazy, setter injection, and Method Extraction for @PostConstruct cycles.
Quick Start:
mvn exec:java -Dexec.mainClass="com.raditha.spring.cycle.CircularDependencyTool" \
-Dexec.args="--config your-config.yml --strategy auto"Finds all classes and methods annotated with a specific annotation.
Quick Start:
# Detailed output (default) - includes full method signatures
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.AnnotationFinder" \
-Dexec.args="Service"
# Simple output - method name only, duplicates eliminated
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.AnnotationFinder" \
-Dexec.args="Service --simple"Features:
- Searches entire codebase for specified annotation
- Handles both simple names (e.g.,
Service) and fully qualified names (e.g.,org.springframework.stereotype.Service) - Two output modes: detailed (default) and simple
- Supports any annotation name (e.g.,
@Service,@Test,@Entity,@Query)
Output Format:
- Class annotations:
com.example.MyService(same in both modes) - Method annotations (detailed mode):
com.example.MyClass#print()orcom.example.MyClass#print(String s) - Method annotations (simple mode):
com.example.MyClass#print(method name only, no duplicates for overloaded methods)
Options:
--simpleor-s: Enable simple output mode (method name only, eliminates duplicates)
Identifies and fixes bad testing patterns (missing assertions, framework migration).
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.TestFixer" -Dexec.args="--dry-run"Analyzes and standardizes logger usage across the codebase, ensuring consistent logging patterns.
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.Logger"Processes all classes in the project and standardizes logger field declarations and usage.
#Audits database indexes defined in Liquibase changelogs.
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.liquibase.Indexes" -Dexec.args="path/to/db.changelog-master.xml"Validates Liquibase changelog XML files for syntax errors and structural issues.
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.mcp.LiquibaseValidator" \
-Dexec.args="path/to/changelog.xml"Outputs validation results in JSON format with exit code 0 for valid files, 1 for invalid.
MCP (Model Context Protocol) server for Liquibase validation, enabling integration with AI agents and tools.
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.mcp.LiquibaseValidationMcpServer"Starts an MCP server that provides Liquibase validation capabilities via the MCP protocol.
Finds hard delete operations in repositories to enforce soft-delete policies.
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.HardDelete"Analyzes collection usage (List, Set, Map) in non-entity classes to detect potential memory issues or N+1 problems.
mvn exec:java -Dexec.mainClass="sa.com.cloudsolutions.antikythera.examples.UsageFinder"📖 Documentation — includes the helper API and validation metric used in tests.
Generates knowledge graphs from Java codebases, visualizing relationships between classes, methods, and dependencies.
mvn exec:java -Dexec.mainClass="com.raditha.graph.KnowledgeGraphCLI" \
-Dexec.args="--base-path=/path/to/project --config=src/main/resources/graph.yml"- Builds comprehensive dependency graphs
- Configurable analysis scope via YAML configuration
- Visualizes code relationships and dependencies