📦 Useful Java Spring Boot Libraries
📦 Useful Java Spring Boot Libraries
🔹 Core & Common Utilities
- Spring Boot Starter Web → Build REST APIs and MVC apps.
- Spring Boot Starter Data JPA → Simplified database access with Hibernate.
- Spring Boot Starter Validation → Bean validation (
@Valid,@NotNull, etc.). - Spring Boot DevTools → Auto-restart and hot reload during development.
- Spring Boot Actuator → Health checks, metrics, monitoring.
- MapStruct → Automatic DTO ↔ Entity mapping.
- Lombok → Boilerplate reduction (
@Getter,@Builder, etc.). - Apache Commons / Google Guava → Utility functions (collections, strings, caching).
🔹 Database & Persistence
- Hibernate → JPA implementation for ORM.
- Flyway / Liquibase → Database schema migrations & versioning.
- Spring Data Redis / MongoDB / Cassandra → NoSQL integrations.
- HikariCP → High-performance JDBC connection pooling (default in Spring Boot).
🔹 Security & Authentication
- Spring Security → Authentication & authorization framework.
- Spring Security OAuth2 / JWT → OAuth2 & JWT-based authentication.
- jjwt (Java JWT) → Simple JWT token handling.
- BCrypt → Secure password hashing.
🔹 API & Communication
- Spring WebFlux → Reactive programming & APIs.
- OpenFeign → Declarative REST client (easy HTTP calls).
- Spring Cloud OpenFeign → REST client with service discovery.
- Resilience4j → Circuit breaker, retry, rate limiter (microservices resilience).
- Spring Cloud Gateway → API gateway for microservices.
- Spring Kafka / RabbitMQ / ActiveMQ → Messaging & event-driven communication.
🔹 Logging & Monitoring
- SLF4J + Logback → Standard logging setup.
- Log4j2 → Alternative logging framework.
- Micrometer → Metrics collection (integrates with Prometheus, Grafana).
- Zipkin / Sleuth → Distributed tracing in microservices.
- ELK Stack (ElasticSearch, Logstash, Kibana) → Log aggregation & search.
🔹 Testing
- JUnit 5 → Unit testing framework.
- Mockito → Mocking framework for unit tests.
- Spring Boot Starter Test → Preconfigured testing setup (JUnit, Mockito, JSON path, etc.).
- Testcontainers → Run real databases (Postgres, MySQL, Kafka, etc.) in Docker for integration tests.
- Rest Assured → Testing REST APIs.
🔹 Build & Productivity
- Maven / Gradle Plugins → Build automation.
- SpringDoc OpenAPI / Swagger → API documentation generation.
- Docker Maven/Gradle Plugin → Containerize apps easily.
–
🔹 Other Utility
- Quartz Scheduler - Jobs schedulers
- ShedLock - distributed schedulers
- Ensures scheduled tasks run only once in a cluster (when multiple instances of your app are running)
âš¡ Quick Rule of Thumb
- Must-have basics → Spring Boot Starter Web, JPA, Validation, Lombok, Actuator.
- DB migration → Flyway or Liquibase.
- Security → Spring Security + JWT.
- Resilience → Resilience4j.
- Docs → SpringDoc OpenAPI.
- Testing → JUnit 5, Mockito, Testcontainers.