A comprehensive Spring Boot application demonstrating modern DevOps practices, functional web programming, and automated CI/CD pipelines with intelligent version management and Podman-based containerization.
- Spring Boot 3.5.5 with Java 21 (latest LTS)
- Functional web framework with RouterFunction pattern
- Automated CI/CD pipelines with GitHub Actions
- Intelligent version management with automatic SNAPSHOT handling
- Podman-based containerization with security-first approach
- Nexus integration for artifact and container registry management
- Production-ready with comprehensive monitoring and security
- Java 21
- Maven 3.6+
- Podman or Docker (for containerization)
# Clone the repository
git clone https://github.com/adeutschmann/spring-boot-helloworld.git
cd spring-boot-helloworld
# Run the application
./mvnw spring-boot:run
# Test the endpoint
curl http://localhost:8080/hello
Response:
{
"message": "Hello World"
}
src/main/java/ch/adeutschmanndev/helloworld/
βββ HelloworldApplication.java # Main Spring Boot application
βββ resource/
β βββ HelloWorldHandler.java # Request handler with business logic
βββ router/
βββ HelloWorldRouter.java # RouterFunction configuration
- Functional Programming: Uses Spring's RouterFunction instead of traditional @Controller
- Clean Architecture: Separation of concerns with handler and router classes
- 12-Factor App: Cloud-native design principles
- Security-First: Non-root containers and minimal attack surface
This project demonstrates multiple enterprise-grade features. Each feature has detailed documentation:
- Functional Web Framework - RouterFunction and handler pattern implementation
- Spring Boot Configuration - Modern Spring Boot 3.5.5 with Java 21 setup
- Podman Containerization - Security-first, rootless container builds
- Multi-Stage Container Build - Optimized Alpine-based production containers
- Container Deployment Guide - Comprehensive container deployment instructions
- GitHub Actions CI/CD - Automated build, test, and deployment pipelines
- Intelligent Version Management - Automatic SNAPSHOT removal and version incrementing
- Nexus Integration - Artifact and container registry management
- Nexus Setup Guide - Step-by-step GitHub secrets and Nexus configuration
- Local Development Setup - IDE integration and debugging
- Testing Strategy - Unit testing and validation approaches
- Security Implementation - Container security, secrets management, and best practices
- Production Readiness - Monitoring, health checks, and operational considerations
# Using Podman (recommended)
podman pull your-nexus-registry.com:8082/spring-boot-helloworld:latest
podman run -p 8080:8080 your-nexus-registry.com:8082/spring-boot-helloworld:latest
# Using Docker
docker pull your-nexus-registry.com:8082/spring-boot-helloworld:latest
docker run -p 8080:8080 your-nexus-registry.com:8082/spring-boot-helloworld:latest
# Build with Podman
podman build -t spring-boot-helloworld:latest -f Containerfile .
# Build with Docker
docker build -t spring-boot-helloworld:latest -f Containerfile .
- JAR Deployment: Automatic Maven artifact deployment to Nexus
- Container Images: Podman-based builds for linux/amd64 platform
- Version Management: Automatic version incrementing and Git tagging
- Quality Gates: Automated testing and build validation
Container images are automatically built and pushed to Nexus registry:
- Release images:
nexus-registry:8082/spring-boot-helloworld:1.0.2
- Latest tag:
nexus-registry:8082/spring-boot-helloworld:latest
- Development images:
nexus-registry:8082/spring-boot-helloworld:1.0.3-SNAPSHOT-abc12345
- Eliminates manual version bumping
- Ensures clean release versions in Nexus (no SNAPSHOT suffixes)
- Maintains development continuity with automatic SNAPSHOT preparation
- Provides complete release traceability through Git tags
- Implements secure, rootless container builds in CI/CD
- Achieves full Docker compatibility without Docker daemon dependency
- Integrates seamlessly with existing Maven and Nexus workflows
- Provides enhanced security through daemon-free architecture
- IntelliJ IDEA: Pre-configured for debug mode
- Comprehensive .gitignore: Excludes .idea, target, and build artifacts
- Maven wrapper: Ensures consistent build environment
- Security hardened: Non-root user (UID 1001), minimal Alpine base
- Multi-stage build: Optimized for production deployment
- Health checks: Built-in monitoring and liveness probes
- Resource optimized: Container-aware JVM settings
- Health endpoint:
/hello
serves as health check - Container labels: OCI-compliant metadata for operational insights
- Logging: Comprehensive application logging
- Resource limits: Kubernetes-ready resource constraints
This project demonstrates enterprise-grade patterns and serves as a reference implementation for:
- Modern Spring Boot development practices
- Functional web programming patterns
- DevOps automation with GitHub Actions
- Secure containerization with Podman
- Intelligent release management
- Nexus Setup Guide - Step-by-step Nexus and GitHub configuration
- Container Deployment Guide - Comprehensive container deployment instructions
- API Documentation - Complete endpoint documentation
Built with β€οΈ using Spring Boot, Java 21, Podman, and modern DevOps practices