This repository is a starting point for Spring Boot applications. It includes equivalent Maven and Gradle configurations so that a project can choose one build system after it is created from the template.
The two configurations describe the same application. They are not intended to remain as parallel sources of build configuration in a derived project.
- JDK 25
- A POSIX-compatible shell for
mvnworgradlewon macOS and Linux - PowerShell or Command Prompt for
mvnw.cmdorgradlew.baton Windows
The wrappers download the required Maven or Gradle distribution, so a global installation of either build tool is not required.
- Select Use this template on GitHub and create a repository.
- Clone the new repository.
- Replace the sample coordinates, package, and application name.
- Choose Maven or Gradle and remove the files for the other build system.
- Run the build for the selected system.
At minimum, update these sample values:
dev.sobue.demoin the Java package and build configurationdemoin the artifact name, root project name, andspring.application.name0.0.1-SNAPSHOTif the project uses a different initial version
Keep these files and directories:
pom.xml.mvn/mvnwmvnw.cmd.github/workflows/maven.yml
Remove these Gradle-specific files and directories:
build.gradlesettings.gradlegradle/gradlewgradlew.bat.github/workflows/gradle.yml
Build and run the application:
./mvnw --batch-mode verify
./mvnw spring-boot:runKeep these files and directories:
build.gradlesettings.gradlegradle/gradlewgradlew.bat.github/workflows/gradle.yml
Remove these Maven-specific files and directories:
pom.xml.mvn/mvnwmvnw.cmd.github/workflows/maven.yml
Build and run the application:
./gradlew build
./gradlew bootRunGraalVM is required to build a native executable.
With Maven:
./mvnw --batch-mode -Pnative native:compile -DskipTestsWith Gradle:
./gradlew nativeCompileThe template contains Maven and Gradle workflows. Both workflows:
- builds and tests the application on JDK 25 and JDK 26;
- builds a native executable with GraalVM JDK 25.
The Maven workflow also runs the SonarQube scan on its JDK 25 build when the
SONAR_TOKEN repository secret is set. The SonarQube configuration is in
pom.xml; the Gradle workflow does not run that scan.
After choosing a build system, keep only its workflow. This prevents duplicate builds and keeps the selected build definition authoritative.
src/main/java/ Application source code
src/main/resources/ Application configuration and resources
src/test/java/ Automated tests
.github/workflows/ Maven and Gradle CI alternatives