┌─────────────────────────────────────────────────────────────┐
│ Web Browser │
│ (User Interface) │
└────────────────────┬────────────────────────────────────────┘
│ HTTP/HTTPS
│
┌────────────────────▼────────────────────────────────────────┐
│ OpenLiberty Server │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Jakarta EE Servlets │ │
│ │ ┌────────────┐ ┌────────────┐ ┌──────────────┐ │ │
│ │ │ Home │ │ Analyzer │ │ Fixer │ │ │
│ │ │ Servlet │ │ Servlet │ │ Servlet │ │ │
│ │ └─────┬──────┘ └─────┬──────┘ └──────┬───────┘ │ │
│ └────────┼───────────────┼─────────────────┼──────────┘ │
│ │ │ │ │
│ ┌────────▼───────────────▼─────────────────▼──────────┐ │
│ │ Business Logic Layer │ │
│ │ ┌──────────────────┐ ┌────────────────────┐ │ │
│ │ │ Issue Detector │ │ Auto Fixer │ │ │
│ │ │ - Pattern Match │ │ - Transformation │ │ │
│ │ │ - File Scan │ │ - Backup Creation │ │ │
│ │ │ - Multi-Module │ │ - Batch Process │ │ │
│ │ └──────────────────┘ └────────────────────┘ │ │
│ └──────────────────────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────▼─────────────────────────────┐ │
│ │ Data Models │ │
│ │ ┌──────────────┐ ┌──────────────────────────┐ │ │
│ │ │ ProjectInfo │ │ MigrationIssue │ │ │
│ │ └──────────────┘ └──────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────┘ │
└────────────────────┬────────────────────────────────────────┘
│
│ File System Access
│
┌────────────────────▼────────────────────────────────────────┐
│ User's File System │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Gradle Project Files │ │
│ │ - build.gradle │ │
│ │ - settings.gradle │ │
│ │ - gradle-wrapper.properties │ │
│ │ - Multi-module structure │ │
│ └──────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ index.jsp │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Project Selection Section │ │
│ │ - Path input │ │
│ │ - Analyze button │ │
│ └───────────────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Project Information Section │ │
│ │ - Metadata display │ │
│ │ - Statistics cards │ │
│ └───────────────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Issues List Section │ │
│ │ - Filterable issue cards │ │
│ │ - Detailed explanations │ │
│ │ - Fix buttons │ │
│ └───────────────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Results Section │ │
│ │ - Fix results display │ │
│ │ - Success/failure stats │ │
│ └───────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│
│ JavaScript (app.js)
│
▼
┌─────────────────────────────────────────────────────────┐
│ Client-Side Logic │
│ - AJAX requests (Fetch API) │
│ - DOM manipulation │
│ - Event handling │
│ - State management │
│ - UI updates │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ Servlet Layer │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ HomeServlet │ │
│ │ - Route: / │ │
│ │ - Serves main UI │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ ProjectAnalyzerServlet │ │
│ │ - Route: /api/analyze │ │
│ │ - POST: Analyze project │ │
│ │ - GET: Retrieve current analysis │ │
│ │ - Session management │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ IssueFixerServlet │ │
│ │ - Route: /api/fix │ │
│ │ - POST: Apply fixes │ │
│ │ - Batch processing │ │
│ │ - Result aggregation │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ GradleIssueDetector │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Issue Pattern Registry │ │
│ │ - 12 predefined patterns │ │
│ │ - Regex-based matching │ │
│ │ - Severity classification │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Project Scanner │ │
│ │ - Recursive directory traversal │ │
│ │ - .gradle file filtering │ │
│ │ - Multi-module detection │ │
│ │ - Gradle version extraction │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Issue Analyzer │ │
│ │ - Pattern application │ │
│ │ - Context extraction │ │
│ │ - Explanation generation │ │
│ │ - Fix suggestion creation │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ AutoFixer │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Backup Manager │ │
│ │ - Timestamped backups │ │
│ │ - Restore capability │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Fix Transformers │ │
│ │ - Configuration replacements │ │
│ │ - API migrations │ │
│ │ - Property conversions │ │
│ │ - Syntax updates │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Batch Processor │ │
│ │ - Multiple issue handling │ │
│ │ - Result aggregation │ │
│ │ - Error handling │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
User Input (Project Path)
│
▼
ProjectAnalyzerServlet
│
├─► Validate path
│
├─► Create GradleIssueDetector
│
├─► analyzeProject()
│ │
│ ├─► Scan directory structure
│ │
│ ├─► Detect modules
│ │
│ ├─► Extract Gradle version
│ │
│ ├─► For each .gradle file:
│ │ │
│ │ ├─► Apply patterns
│ │ │
│ │ ├─► Extract matches
│ │ │
│ │ ├─► Generate explanations
│ │ │
│ │ └─► Create MigrationIssue objects
│ │
│ └─► Aggregate results
│
├─► Create ProjectInfo
│
├─► Store in session
│
└─► Return JSON response
│
▼
Display in UI
User Selection (Issue IDs)
│
▼
IssueFixerServlet
│
├─► Retrieve ProjectInfo from session
│
├─► Find selected issues
│
├─► Create AutoFixer
│
├─► For each issue:
│ │
│ ├─► Validate auto-fixable
│ │
│ ├─► Create backup
│ │ │
│ │ └─► file.backup.timestamp
│ │
│ ├─► Read file content
│ │
│ ├─► Apply transformation
│ │ │
│ │ ├─► Pattern matching
│ │ │
│ │ ├─► String replacement
│ │ │
│ │ └─► Regex substitution
│ │
│ ├─► Write fixed content
│ │
│ └─► Create FixResult
│
├─► Aggregate results
│
├─► Update session
│
└─► Return JSON response
│
▼
Display results in UI
HttpSession
│
├─► currentProject (ProjectInfo)
│ │
│ ├─► projectPath
│ ├─► projectName
│ ├─► currentGradleVersion
│ ├─► isMultiModule
│ ├─► modules[]
│ └─► issues[]
│ │
│ └─► MigrationIssue[]
│ │
│ ├─► id
│ ├─► type
│ ├─► severity
│ ├─► filePath
│ ├─► lineNumber
│ ├─► currentCode
│ ├─► suggestedFix
│ └─► explanation
│
└─► Session timeout: 30 minutes
JavaScript State
│
├─► currentProject (object)
│
├─► allIssues (array)
│
└─► selectedIssues (Set)
┌─────────────────────────────────────────┐
│ User Input │
└───────────┬─────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Validation Layer │
│ - Path sanitization │
│ - Null checks │
│ - Format validation │
└───────────┬─────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Business Logic │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Requested Path │
└───────────┬─────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Path Validation │
│ - Exists check │
│ - Readable check │
│ - Directory check │
└───────────┬─────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ File Operations │
│ - Read only (analysis) │
│ - Write with backup (fix) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Developer Machine │
│ ┌───────────────────────────────────┐ │
│ │ ./gradlew libertyDev │ │
│ │ - Hot reload enabled │ │
│ │ - Debug port: 7777 │ │
│ │ - Interactive console │ │
│ └───────────────────────────────────┘ │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Application Server │
│ ┌───────────────────────────────────┐ │
│ │ OpenLiberty / WildFly / Payara │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ gradle-migration-helper.war│ │ │
│ │ └─────────────────────────────┘ │ │
│ └───────────────────────────────────┘ │
│ │
│ HTTP: 9080 │
│ HTTPS: 9443 │
└─────────────────────────────────────────┘
- Concurrent Users: 50+ (session-based)
- File Processing: Async for large projects
- Memory: ~50MB per 1000 files
- Response Time: <5s for typical projects
- Pattern Compilation: Pre-compiled regex patterns
- File Filtering: Early filtering of non-Gradle files
- Lazy Loading: Issues loaded on demand
- Session Management: Efficient state storage
- Batch Processing: Multiple fixes in single transaction
Architecture Version: 1.0.0
Last Updated: October 30, 2024