spring cli version

  1. Open a terminal window.

  2. Navigate to the directory where you want to create your Spring project.

  3. Run the following command to generate a new Spring Boot project using the Spring Initializr: spring init --dependencies=<comma-separated-dependencies> <project-name> Replace <comma-separated-dependencies> with the desired Spring Boot dependencies, and <project-name> with the desired name for your project.

  4. Navigate to the newly created project directory: cd <project-name>

  5. Open the project in your preferred Integrated Development Environment (IDE).

  6. Build the project using the following command: ./mvnw clean install or for Windows: mvnw.cmd clean install

  7. Run the Spring Boot application: ./mvnw spring-boot:run or for Windows: mvnw.cmd spring-boot:run

  8. Access the application by navigating to http://localhost:8080 in your web browser.

  9. Optionally, customize your application code in the IDE, and repeat steps 6 and 7 as needed.

  10. To package the application as a JAR file, use the following command: ./mvnw clean package or for Windows: mvnw.cmd clean package

  11. The packaged JAR file can be found in the target directory.

  12. Deploy the JAR file to a server or cloud platform of your choice.