🌱 Spring Boot Initializer for VS Code
What is this?Spring Boot Initializer is a VS Code extension that brings the full Spring Initializr experience natively into your editor. No browser. No tab switching. No manual ZIP download. No manual extraction. Just:
Features
InstallationFrom the VS Code Marketplace
From a
|
| Setting | Type | Default | Description |
|---|---|---|---|
springBootInitializer.initializrUrl |
string |
https://start.spring.io |
Spring Initializr server URL. Change this to use a private or enterprise Initializr instance. |
Using a Custom Initializr Server
Open VS Code Settings (Ctrl+,) and search for springBootInitializer:
{
"springBootInitializer.initializrUrl": "https://your-internal-initializr.company.com"
}
Commands
| Command | Description |
|---|---|
Spring Boot: Initialize Spring Boot |
Open the Spring Boot project initializer |
Requirements
- Visual Studio Code
1.85.0or higher - Internet access to reach Spring Initializr (or a configured private server)
- No Java installation required — the extension generates the project, it does not run it
How It Works
VS Code
│
├── React Webview (UI)
│ │
│ │ postMessage()
│ ▼
└── Extension Host (Node.js)
│
│ HTTPS
▼
Spring Initializr API
(https://start.spring.io)
│
│ ZIP
▼
Extract → Write to disk
│
▼
VS Code Workspace updated
The Webview handles all user interaction. The Extension Host handles all privileged operations (network, filesystem, VS Code API). They communicate exclusively via postMessage.
Development
Prerequisites
node --version # 20.x LTS recommended
npm --version # 10.x+
git --version
vsce --version # npm install -g @vscode/vsce
Setup
# Clone the repository
git clone https://github.com/H-arshal/spring-app-generator.git
cd spring-app-generator
# Install extension host dependencies
npm install
# Install Webview UI dependencies
cd webview-ui
npm install
cd ..
Build
# Build everything (Webview UI + Extension Host)
npm run build
Run in Development
Press F5 in VS Code to launch the Extension Development Host — a separate VS Code window with the extension loaded.
Then: Ctrl+Shift+P → Spring Boot: Initialize Spring Boot
Watch Mode
npm run watch
Watches both the Extension Host (src/) and Webview UI (webview-ui/src/) for changes.
Tests
# All tests
npm test
# Unit tests only (no VS Code instance needed)
npm run test:unit
# Integration tests (launches VS Code)
npm run test:integration
Project Structure
spring-boot-initializer/
│
├── src/ # Extension Host (TypeScript)
│ ├── extension.ts # Entry point
│ ├── commands/ # Command handlers
│ ├── webview/ # Panel lifecycle + messaging
│ ├── initializr/ # Spring Initializr HTTP client
│ ├── project/ # Generation pipeline + workspace
│ ├── validation/ # Config validators
│ └── utils/ # Logger, error types
│
├── webview-ui/ # Webview React app (TypeScript + Vite)
│ └── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Project / Details / Dependencies
│ ├── hooks/ # useVsCodeApi, useMetadata, useProjectConfig
│ └── services/ # Typed postMessage service
│
├── test/ # Unit + integration tests
├── docs/ # Architecture, design, planning docs
├── media/ # Extension icon
├── package.json # Extension manifest
└── .gitignore
Full architecture details: docs/Architecture.md
Documentation
| Document | Description |
|---|---|
docs/Architecture.md |
System design, runtime boundaries, data flows |
docs/Design.md |
Component design, message contracts, UI layout |
docs/API-Contracts.md |
Spring Initializr API, postMessage types, validation rules |
docs/Implementation-Plan.md |
Milestones, task breakdown, tech decisions |
docs/Tasks.md |
Task tracker with acceptance criteria |
docs/Progress.md |
Progress dashboard and session log |
docs/Decisions.md |
Technical decision log with rationale |
docs/Testing.md |
Test specs and manual test scenarios |
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes following the coding conventions in
docs/Architecture.md - Run tests:
npm test - Commit:
git commit -m "feat: add my feature" - Push:
git push origin feature/my-feature - Open a Pull Request
Please read docs/Design.md before contributing to understand the architecture and component boundaries.
Roadmap
1.0.0 — MVP (current target)
- Native Initializr UI inside VS Code
- Full project configuration
- Dependency search and selection
- Safe project generation and extraction
- Workspace integration
1.1.0 — Productivity
- Recent configurations
- Saved project presets
- Manual metadata refresh command
1.2.0 — Spring Project Management
- Add dependency to existing project
- Dependency management
Future
- AI-assisted configuration (natural language → suggested dependencies)
License
Acknowledgements
- Spring Initializr — the project generation engine this extension is built on
- VS Code Extension API — the platform