spring-maven-modular_skill

This skill enables modular Maven builds for Spring projects by toggling components like Redis, Kafka, and RabbitMQ via profiles and properties.
  • Java

5

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill mduongvandinh/skills-java-spring --skill spring-maven-modular

  • SKILL.md1.6 KB

Overview

This skill implements a Maven-based modular architecture for Spring Boot projects, letting you enable or disable optional components at build time. It provides profile presets (minimal, full-stack) and per-module flags for Redis, Kafka, RabbitMQ, OAuth2, and PostgreSQL. The goal is predictable builds and conditional bean loading to keep the runtime surface minimal and focused.

How this skill works

Modules are toggled via Maven profiles or system properties (e.g., -Dmodule.redis.enabled=true). The build includes or excludes module artifacts and resource wiring based on those flags. At runtime Spring beans use a @ConditionalOnModuleEnabled annotation to register only when the corresponding module flag is active. application.yml maps module flags to environment variables for containerized deployments.

When to use it

  • You need a single codebase that can produce lightweight and full-featured artifacts.
  • Building images for different environments (dev, staging, prod) with different service dependencies.
  • Testing integrations (Redis/Kafka/RabbitMQ) selectively without running all services.
  • Reducing attack surface and startup time by compiling out unused modules.
  • Creating CI pipelines that build multiple configurations from the same source.

Best practices

  • Keep PostgreSQL as the core data module and mark other services optional by default.
  • Use Maven profiles (minimal, full-stack) for common combinations and properties for one-off builds.
  • Document which beans are conditional so maintainers know where modules affect wiring.
  • Prefer environment-variable overrides in application.yml for container and cloud deployments.
  • Run integration tests with module flags enabled to validate conditional wiring and contracts.

Example use cases

  • Produce a minimal artifact for local development with only PostgreSQL and JWT auth using -Pminimal.
  • Build a full-stack image for staging with Redis, Kafka, and OAuth2 via -Pfull-stack.
  • Enable Redis and Kafka for a feature branch using -Dmodule.redis.enabled=true -Dmodule.kafka.enabled=true.
  • CI matrix that compiles artifacts for several combinations to detect integration regressions early.

FAQ

Annotate configuration classes with @ConditionalOnModuleEnabled("moduleName") so they only register when the corresponding module flag is true.

Can I control modules with environment variables?

Yes. application.yml reads module flags from environment variables (e.g., MODULE_REDIS_ENABLED) so you can control modules in containers and CI.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational