Required tools, installation, and IDE setup for the Java Enterprise Template.
- Prerequisites
- Installation
- Verify Installation
- IDE Setup
- Maven Wrapper
- Quality Tools
- Docker
- Related Docs
| Tool | Version | Purpose |
|---|---|---|
| JDK | 21+ (Temurin recommended) | Build & runtime — source compatibility targets Java 21 |
| Maven | 3.9+ (wrapper included) | Build system — ./mvnw is provided, no global install needed |
| Docker | 24+ | Container builds, Testcontainers for integration tests |
| Git | 2.x | Version control |
The project uses Java 21 language features (maven.compiler.source=21 via <java.version>21</java.version>) and builds and runs on JDK 21 in CI and Docker. A JDK ≥ 21 is required; Temurin 21 is recommended for consistency with CI.
These run as Maven plugins — no separate installation required:
| Tool | Plugin Version | Purpose |
|---|---|---|
| SpotBugs | 4.9.8.3 | Bug detection |
| Find Security Bugs | 1.13.0 | Security-focused static analysis |
| Checkstyle | 3.3.1 (engine 10.14.2) | Code style enforcement |
| PMD | 3.22.0 | Static analysis |
| OWASP Dependency-Check | 9.1.0 | CVE scanning of dependencies |
| JaCoCo | 0.8.12 | Code coverage |
| Spotless | 2.43.0 | Code formatting (Google Java Format) |
# JDK 21 (Eclipse Temurin)
brew install --cask temurin@21
# Docker Desktop
brew install --cask docker
# Git (usually pre-installed with Xcode CLI tools)
xcode-select --install# JDK 21 (Eclipse Temurin via Adoptium APT repo)
sudo apt-get install -y wget apt-transport-https gpg
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | \
sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/adoptium.gpg
echo "deb https://packages.adoptium.net/artifactory/deb $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/adoptium.list
sudo apt-get update && sudo apt-get install -y temurin-21-jdk
# Docker
sudo apt-get install -y docker.io
sudo usermod -aG docker $USER # log out and back in
# Git
sudo apt-get install -y git# Using winget
winget install EclipseAdoptium.Temurin.21.JDK
winget install Docker.DockerDesktop
winget install Git.GitOr download installers from:
- JDK: https://adoptium.net/temurin/releases/?version=21
- Docker: https://www.docker.com/products/docker-desktop/
- Git: https://git-scm.com/download/win
# All of these should succeed before working with the project
java -version # Expected: openjdk 21.x.x
./mvnw --version # Expected: Apache Maven 3.9.x
docker --version # Expected: Docker 24.x+
git --version # Expected: git 2.xQuick build test:
./mvnw -B clean verify -DskipTests- Open project: File → Open → select the root
pom.xml→ "Open as Project" - Set JDK: File → Project Structure → Project SDK → select Temurin 21
- Import Maven: IntelliJ auto-detects the POM. If not, right-click
pom.xml→ "Add as Maven Project" - Code style: Install the Checkstyle-IDEA plugin
- Settings → Tools → Checkstyle → add
config/checkstyle/checkstyle.xml
- Settings → Tools → Checkstyle → add
- Recommended plugins:
- Checkstyle-IDEA — real-time Checkstyle feedback
- SpotBugs — in-IDE bug detection
- MapStruct Support — for modules using MapStruct
- Run configurations: Spring Boot modules (e.g.,
restful-api) can be run directly via theApplicationmain class
- Required extension: Extension Pack for Java (includes Language Support, Debugger, Maven, Test Runner)
- Open project: File → Open Folder → select the project root
- Recommended extensions (add to
.vscode/extensions.json):{ "recommendations": [ "vscjava.vscode-java-pack", "vscjava.vscode-maven", "vmware.vscode-spring-boot", "redhat.java", "SonarSource.sonarlint-vscode" ] } - Settings: Add to
.vscode/settings.json:{ "java.configuration.updateBuildConfiguration": "automatic", "java.compile.nullAnalysis.mode": "automatic" }
The project includes a Maven Wrapper (mvnw / mvnw.cmd), so a global Maven install is optional. Always use the wrapper to ensure consistent Maven versions:
./mvnw clean verify # Build + unit tests
./mvnw verify -Psecurity-scan # Full quality + security scan
./mvnw verify -Pformat # Auto-format code with SpotlessIf you need to update the wrapper version:
mvn wrapper:wrapper -Dmaven=3.9.9All quality tools are configured in the root pom.xml and activated via Maven profiles. No separate installation is needed.
| Command | What it runs |
|---|---|
./mvnw verify |
Compile + unit tests + JaCoCo coverage |
./mvnw verify -Psecurity-scan-quick |
+ SpotBugs + Checkstyle + PMD |
./mvnw verify -Psecurity-scan |
+ all above + OWASP Dependency-Check |
./mvnw verify -Pformat |
Auto-format with Google Java Format |
./mvnw verify -Pintegration-tests |
Run integration tests (Failsafe) |
Configuration files in the config/ directory:
| File | Tool |
|---|---|
config/checkstyle/checkstyle.xml |
Checkstyle rules |
config/checkstyle/checkstyle-suppressions.xml |
Checkstyle suppressions |
config/pmd/pmd-ruleset.xml |
PMD rules |
config/spotbugs/spotbugs-exclude.xml |
SpotBugs exclusions |
config/owasp/owasp-suppressions.xml |
OWASP false-positive suppressions |
For detailed usage, suppression guides, and CI integration, see SECURITY_SCANNING.md.
The restful-api module includes a Dockerfile using eclipse-temurin:21-jre-alpine:
# Build the JAR first
./mvnw package -pl examples/restful-api -am -DskipTests
# Build the Docker image
docker build -t java-template-api:latest -f examples/restful-api/Dockerfile examples/restful-api
# Run
docker run -p 8080:8080 java-template-api:latestThe image runs as a non-root user and includes a health check on /actuator/health.
Docker is also required for Testcontainers (used in integration tests for database and other modules). Ensure Docker is running before executing integration tests.
- README — Project overview and quick start
- Development Workflow — Day-to-day development, CI/CD, adding modules
- Security Scanning — Detailed security tool configuration and usage
- Architecture Patterns — Template structure and design patterns
- Best Practices — Coding standards and conventions