diff --git a/README.md b/README.md index 9a7a728..993d67b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ See below details on how to start each of them. This project uses [Maven](https://maven.apache.org/what-is-maven.html) as build tool. -In order to build it, just do the well-known: +In order to build it, just run the well-known Maven command: ``` mvn clean install @@ -28,6 +28,12 @@ To build without executing automated tests: mvn clean install -DskipTests ``` +Alternatively, Gradle can also be used: + +``` +gradle clean build +``` + Java 21 is used for this project. ## Starting Spring Boot REST Application @@ -39,6 +45,12 @@ in the project's root directory: mvn -pl restapp spring-boot:run ``` +Alternatively, the following Gradle command can also be used: + +``` +gradle :restapp:bootRun +``` + The following REST operations, as defined in the OpenAPI specification, will be exposed on HTTP `localhost:9090`: @@ -54,6 +66,12 @@ in the project's root directory: mvn -pl webapp spring-boot:run ``` +Alternatively, the following Gradle command can also be used: + +``` +gradle :webapp:bootRun +``` + Open the browser and go to the following address: ``` diff --git a/openapi-spec/build.gradle b/openapi-spec/build.gradle index 6ffa225..3eecb0e 100644 --- a/openapi-spec/build.gradle +++ b/openapi-spec/build.gradle @@ -14,10 +14,9 @@ buildscript { plugins { id 'buildlogic.java-conventions' + id 'org.openapi.generator' version '7.12.0' } -apply plugin: 'org.openapi.generator' - dependencies { api libs.com.google.code.findbugs.jsr305 api libs.com.google.code.gson.gson diff --git a/restapp/build.gradle b/restapp/build.gradle index d2b01d7..ee57ed0 100644 --- a/restapp/build.gradle +++ b/restapp/build.gradle @@ -4,10 +4,13 @@ plugins { id 'buildlogic.java-conventions' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'java' } dependencies { - api project(':openapi-spec') + implementation project(':openapi-spec') api libs.com.google.zxing.core api libs.com.google.zxing.javase api libs.org.springframework.boot.spring.boot.starter @@ -16,3 +19,7 @@ dependencies { } description = 'REST layer' + +springBoot { + mainClass = 'edu.training.qrcodeapp.rest.QRCodeGeneratorRestApp' +} diff --git a/settings.gradle b/settings.gradle index cb81eeb..6d8f06a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,13 @@ * This file was generated by the Gradle 'init' task. */ +pluginManagement { + plugins { + id 'org.springframework.boot' version '3.4.4' + id 'io.spring.dependency-management' version '1.1.7' + } +} + rootProject.name = 'qrcodeapp' include(':openapi-spec') include(':restapp') diff --git a/webapp/build.gradle b/webapp/build.gradle index 8cf8c78..ee50351 100644 --- a/webapp/build.gradle +++ b/webapp/build.gradle @@ -4,10 +4,13 @@ plugins { id 'buildlogic.java-conventions' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'java' } dependencies { - api project(':openapi-spec') + implementation project(':openapi-spec') api libs.org.springframework.boot.spring.boot.starter.validation api libs.org.springframework.boot.spring.boot.starter.web api libs.org.springframework.boot.spring.boot.starter.thymeleaf @@ -19,3 +22,7 @@ dependencies { } description = 'Web Application' + +springBoot { + mainClass = 'edu.training.qrcodeapp.web.QRCodeGeneratorWebApp' +}