Index of every page on this site: llms.txt
All skills
github avatar

/create-spring-boot-java-project

@f10fdb8 official
by githubgithub/awesome-copilot41k stars
5,399
Run it yourself

Create a new Spring Boot Java project (Maven or Gradle) from start.spring.io with sensible defaults for configuration, PostgreSQL, logging, security, testing and Docker. Use when asked to scaffold, bootstrap or generate a Spring Boot application. Detects existing project versions and never upgrades implicitly.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/create-spring-boot-java-project

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesdocker.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Docker

Four multi-stage Dockerfiles are provided: JVM and GraalVM native images, each for Maven and Gradle (Groovy or Kotlin DSL). Copy the one you need to the project root and build it with -f. AOT and CRaC images are deferred.

Maven Gradle
JVM image ../assets/Dockerfile ../assets/Dockerfile-gradle
Native image ../assets/Dockerfile-native ../assets/Dockerfile-native-gradle

Verified on Boot 4.1.1 (web + actuator + validation), arm64 Docker Desktop: all four build and serve /hello and /actuator/health. JVM images are about 200 MB and build in under a minute (about 2 s startup); native images are about 175 MB, take 2m20-2m55 to build (around 6 GB of builder memory) and start in about 0.09 s. The Gradle builds set the toolchain to the same Java version as the build stage (25).

Choosing

JVM image Native image
Build time Fast Slow, memory hungry (several GB)
Startup / memory Seconds / higher Milliseconds / low
Compatibility Everything Needs GraalVM-compatible libraries; reflection hints may be needed
Pick when Default choice Scale-to-zero, CLI-like, tight memory limits

Native requires the native dependency at generation time (-d dependencies=...,native) and the Spring Boot native Maven profile (included by start.spring.io when the dependency is selected).

Properties of the provided Dockerfiles

  • Multi-stage: build in a JDK/GraalVM image, run in a small runtime image.
  • JVM: the Boot jar is extracted into layers (java -Djarmode=tools -jar app.jar extract --layers --launcher) for better caching, runtime assembled with jlink, final base is distroless nonroot (no shell, no package manager).
  • Native: the executable is built with -H:+StaticExecutableWithDynamicLibC and copied into distroless nonroot. The find that picks the executable must skip *.so: GraalVM 25 leaves executable libjava.so/libjvm.so stubs next to it, and copying one of those gives a container that exits with 139 (segfault).
  • Run as non-root, expose 8080, JVM flags via JAVA_TOOL_OPTIONS (no shell to expand JAVA_OPTS).
  • Pinned base image tags (eclipse-temurin:25-jdk-noble, ghcr.io/graalvm/graalvm-community:25, gcr.io/distroless/base-debian12:nonroot); match the Java version of the project and update when it changes. Consider pinning by digest for reproducibility.
  • No Docker HEALTHCHECK (distroless has no curl); probe /actuator/health from the orchestrator (liveness/readiness: management.endpoint.health.probes.enabled=true).
  • Keep a .dockerignore (target/, build/, .git, .env, IDE files) so secrets and build output stay out of the context.

Build and run

docker build -t my-spring-app .
docker run --rm -p 8080:8080 \
  -e SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/mydb \
  -e SPRING_DATASOURCE_USERNAME=user -e SPRING_DATASOURCE_PASSWORD=password \
  my-spring-app

Alternative without a Dockerfile: ./mvnw spring-boot:build-image or ./gradlew bootBuildImage (Cloud Native Buildpacks; add -Pnative for native with Maven, Gradle needs the org.graalvm.buildtools.native plugin). Verified on Boot 4.1.1 (web + actuator + validation + data-jpa, Java 25): Maven native build-image about 2m40, 282 MB image; Gradle bootBuildImage 2-4 min, image starts in 0.1-0.2 s and /actuator/health returns UP with native-build-tools 1.1.7 and 1.1.8. A native image that crashes at startup with Invalid logger interface org.hibernate.validator.internal.util.logging.Log (implementation not found) was seen once with Gradle but could not be reproduced; it matches graalvm/native-build-tools#1017 (Gradle collectReachabilityMetadata overwrote the hibernate-validator metadata with the jboss-logging one, leaving a ~2 KB file). If it happens, check unzip -l build/libs/*.jar | grep hibernate-validator.*reachability-metadata.json (healthy is about 150 KB), upgrade org.graalvm.buildtools.native to the latest release and rebuild with --no-build-cache; always run the image and hit /actuator/health.

Development

Use spring-boot-docker-compose with compose.yaml for dependencies (see database.md); do not containerize the application itself during development.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1d5 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    This skill scaffolds a Spring Boot project using official and well-known industry services with strong security best practices, including non-root Docker images and secure secret management instructions.

  • Socket1d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

  • Runlayer8mo

    1/1 file flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
  • spring-boot
  • java
  • maven
  • postgres
  • redis
  • mongodb
  • docker
  • scaffold

README badge

README badge for github/awesome-copilot/create-spring-boot-java-project

Scaffolds a Spring Boot 3.4.5 Maven project with Java 21, preconfigured with PostgreSQL, Redis, MongoDB, and Docker Compose services. Includes SpringDoc OpenAPI for API documentation and ArchUnit for architecture testing, with default credentials and port mappings ready to use.

Generated from the current SKILL.md.

What Java version does this skill require?
Java 21. The skill generates a Spring Boot 3.4.5 project configured for Java 21.
Can I customize the project name and Spring Boot version?
Yes. You can modify the `artifactId`, `packageName`, and `bootVersion` parameters in the download command before running it.
What databases and services are included?
The skill sets up PostgreSQL, Redis, and MongoDB via docker-compose, along with SpringDoc OpenAPI for API documentation and ArchUnit for architecture testing.
Do I need Docker installed?
Yes. The skill requires both Docker and Docker Compose to run the included database services (Redis, PostgreSQL, MongoDB).

Generated from the current SKILL.md. These answers refresh after source changes.