arabelatso/spring-mvc-to-boot-migrator
Automatically migrate Spring MVC applications to Spring Boot. Use when you need to modernize a Spring MVC project to Spring Boot while preserving functionality. The skill analyzes the codebase, updates build configuration (Maven/Gradle), migrates annotations, converts XML configuration to Java/properties, updates controllers and tests, and creates the Spring Boot main application class. Creates git commits for each migration phase and generates a comprehensive summary. Supports both Maven and Gradle projects.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill spring-mvc-to-boot-migrator
This skill automatically migrates Spring MVC applications to Spring Boot, transforming build configuration, annotations, XML configuration, controllers, and tests while preserving existing functionality. It handles Maven and Gradle projects, creates incremental git commits, and generates detailed migration summaries.
# Navigate to your Spring MVC project
cd /path/to/spring-mvc-project
# Run migration (auto-detects Maven or Gradle)
python scripts/migrate.py .
# Or specify build tool explicitly
python scripts/migrate.py . --build-tool maven
The migration process will:
# Migrate Spring MVC project
python scripts/migrate.py /path/to/project
# Output:
# ✓ Detected build tool: maven
# ✓ Detected Spring version: 5.3.20
# ✓ Created migration branch: migrate-spring-mvc-to-boot
# ✓ Analyzing codebase...
# ✓ Found 8 controllers
# ✓ Found 12 services
# ✓ Found 15 test files
# ✓ Migrating build configuration...
# ✓ Migrating annotations...
# ✓ Migrating configuration...
# ✓ Migrating tests...
# ✓ Migration completed successfully!
What gets migrated:
@Controller + @ResponseBody → @RestController@RequestMapping(method = RequestMethod.GET) → @GetMapping@PostMapping, @PutMapping, @DeleteMappingjavax.* to jakarta.*@RunWith(SpringRunner.class) → @SpringBootTest@AutoConfigureMockMvcExample transformation:
Before (Spring MVC):
@Controller
@RequestMapping("/users")
public class UserController {
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List<User> getUsers() {
return userService.findAll();
}
}
After (Spring Boot):
@RestController
@RequestMapping("/users")
public class UserController {
@GetMapping
public List<User> getUsers() {
return userService.findAll();
}
}
The migration tool automatically:
Maven projects:
Gradle projects:
Updates Java annotations:
@RestController)@GetMapping, @PostMapping, etc.)javax.* → jakarta.*)@SpringBootApplicationConverts configuration:
application.properties with common settingsUpdates test files:
Creates comprehensive report:
MIGRATION_SUMMARY.jsonpython scripts/migrate.py <repo_path> [--build-tool <maven|gradle|auto>]
# Options:
# repo_path: Path to the Spring MVC repository
# --build-tool: Build tool (default: auto-detect)
You can also run individual migration steps:
from migrate_build import BuildMigrator
from migrate_annotations import AnnotationMigrator
from migrate_config import ConfigMigrator
from migrate_tests import TestMigrator
# Run specific migration
migrator = AnnotationMigrator(repo_path)
migrator.migrate()
After migration completes:
git log --oneline
git diff main..migrate-spring-mvc-to-boot
# Maven
mvn clean package
# Gradle
gradle clean build
# Maven
mvn spring-boot:run
# Gradle
gradle bootRun
# Or run JAR directly
java -jar target/myapp.jar
# Maven
mvn test
# Gradle
gradle test
curl http://localhost:8080/users
git checkout main
git merge migrate-spring-mvc-to-boot
references/migration_guide.md - Comprehensive step-by-step migration guide covering all aspects from build configuration to testing, with detailed examples and troubleshootingreferences/framework_comparison.md - Detailed comparison of Spring MVC and Spring Boot including architecture, configuration, controllers, testing, and deploymentExample controller files are provided in assets/:
UserController_Before.java - Spring MVC controller before migrationUserController_After.java - Spring Boot controller after migrationCompare these files to understand the transformations applied.
After migration, review MIGRATION_SUMMARY.json:
{
"source_framework": "Spring MVC",
"target_framework": "Spring Boot",
"build_tool": "maven",
"total_changes": 35,
"changes_by_type": {
"build": 5,
"annotation": 12,
"config": 6,
"test": 12
},
"files_modified": [...],
"next_steps": [...]
}
Issue: Application won't start
@SpringBootApplication annotation and correct package structureIssue: Controllers not found
Issue: Build fails
mvn clean install or gradle clean build to refresh dependenciesIssue: Tests fail
Issue: Database connection fails
See references/migration_guide.md for detailed troubleshooting.
Take arabelatso/spring-mvc-to-boot-migrator from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.