Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Spring Boot Boilerplate Setup Guide

This guide will help you set up and run the Spring Boot Boilerplate application locally.


Prerequisites

Before you start, ensure you have the following installed on your machine:

  • Java Development Kit (JDK): Ensure you have JDK 21 (or the required version installed for your setup).
  • Gradle: (Optional) The project includes the Gradle Wrapper, so you don't need a system-wide Gradle installation.

Setup Instructions

Step 1: Clone or Fork the Repository

Clone the repository using the following command:

git clone https://github.com/Prem-Dharshan/springboot_boilerplate.git

Navigate to the project directory:

cd springboot_boilerplate

Alternatively, fork the repository and clone it from your fork.


Step 2: Update the Java Version in build.gradle

Open the build.gradle file and ensure the Java version matches the version installed on your machine. Modify the java.toolchain block as follows:

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21) // Replace 21 with your desired Java version
    }
}

Save the file after making the changes.


Step 3: Update Gradle Wrapper Version (if necessary)

If your Gradle version is outdated, update it in the gradle-wrapper.properties file:

  1. Open the file located at gradle/wrapper/gradle-wrapper.properties.
  2. Update the distributionUrl to the desired Gradle version. For example:
    distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip

You can check the Gradle Releases Page to find the latest version.


Step 4: Build the Project

Run the Gradle build command to compile the application:

./gradlew build

On Unix-based systems, if you encounter permission issues, use:

chmod +x gradlew
./gradlew build

Step 5: Run the Application

Start the application with the following command:

./gradlew bootRun

Step 6: Access the Application

Once the application starts, it will be accessible at:


Troubleshooting

Common Issues and Fixes:

  1. Build Fails:

    • Ensure the correct Java version is installed and matches the build.gradle configuration.
    • Clean the project if you encounter issues:
      ./gradlew clean
  2. Port Already in Use:

    • Stop the existing process running on port 8080 or modify the server.port property in src/main/resources/application.properties:
      server.port=8081
  3. Gradle Version Compatibility:

    • If you encounter issues due to an outdated Gradle version, ensure the distributionUrl in gradle-wrapper.properties points to a compatible version of Gradle for your Java version.

Contributing

If you make improvements or fixes, consider contributing by opening a pull request to the original repository.


Additional Commands

  • To run tests:

    ./gradlew test
  • To clean the project:

    ./gradlew clean
  • To generate a JAR file:

    ./gradlew bootJar

Enjoy coding with the Spring Boot Boilerplate! 🚀

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages