diff --git a/GUIDELINES.md b/GUIDELINES.md index 4ed80bd43..bc7449202 100755 --- a/GUIDELINES.md +++ b/GUIDELINES.md @@ -139,6 +139,8 @@ 10. Start MongoDB Compass, click on "Reload Data" and you should see the database correctly imported. +11. Please, review README.md documents inside each microservice, they may contain additional instructions. +
## 2.2 Git configurations @@ -560,6 +562,8 @@ The following programs are required to work on the project: - **Java SE Development Kit 17.0.7**: Java SE Development Kit (JDK) is a set of tools needed to develop Java applications. Make sure you have installed version 17.0.7 of the JDK which is the one used in this project. You can download [JDK 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) from the official website. +- **Gradle 8.8** + It is important to make sure you have all these tools installed and configured correctly before you start working on the project.
diff --git a/GUIDELINES_CA.md b/GUIDELINES_CA.md index fe9dda7b3..4806a8806 100755 --- a/GUIDELINES_CA.md +++ b/GUIDELINES_CA.md @@ -139,7 +139,11 @@ mongoimport --db=challenges --username admin_challenge --authenticationDatabase mongoimport --db=challenges --username admin_challenge --authenticationDatabase admin --password BYBcMJEEWw5egRUo --collection=solutions --jsonArray --file=./mongodb-test-data/solutions.json ``` -11. Obre MongoDB Compass, fes un "Reload Data" i ja veuràs la base de dades correctament importada. +10. Obre MongoDB Compass, fes un "Reload Data" i ja veuràs la base de dades correctament importada. + + +11. Si us plau, revisa els documents Readme.md dins de cada microservei, pot ser que continguin instruccions addicionals. +
@@ -558,6 +562,9 @@ Els programes següents són requerits per poder treballar en el projecte: - **Java SE Development Kit 17.0.7**: Java SE Development Kit (JDK) és un conjunt d'eines necessàries per desenvolupar aplicacions en Java. Assegureu-vos de tenir instal·lada la versió 17.0.7 del JDK que és la que s'usa en aquest projecte. Podeu descarregar [JDK 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) des del web oficial d'Oracle. +- **Gradle 8.8** + + És important assegurar-se de tenir totes aquestes eines instal·lades i configurades correctament abans de començar a treballar al projecte.
diff --git a/GUIDELINES_ES.md b/GUIDELINES_ES.md index cbe9bc51e..3c39e4241 100755 --- a/GUIDELINES_ES.md +++ b/GUIDELINES_ES.md @@ -143,6 +143,8 @@ mongoimport --db=challenges --username admin_challenge --authenticationDatabase
+11. Por favor, revisa los documentos README.md dentro de cada microservicio, puede que contengan instrucciones adicionales. + ## 2.2 Configuraciones Git Configuraciones Git necesarias para evitar problemas @@ -558,6 +560,8 @@ Los siguientes programas son requeridos para poder trabajar en el proyecto: - **Java SE Development Kit 17.0.7**: Java SE Development Kit (JDK) es un conjunto de herramientas necesarias para desarrollar aplicaciones en Java. Asegúrate de tener instalada la versión 17.0.7 del JDK que es la que se usa en este proyecto. Puedes descargar [JDK 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) desde la web oficial de Oracle. +- **Gradle 8.8** + Es importante asegurarse de tener todas estas herramientas instaladas y configuradas correctamente antes de comenzar a trabajar en el proyecto.
diff --git a/README.md b/README.md index e2a926233..43d76613c 100755 --- a/README.md +++ b/README.md @@ -54,7 +54,8 @@ It is important to make sure you have all these tools installed and configured c - **MongoDB** - **Docker** -- **Java SE Development Kit 17.0.7** +- **Java SE Development Kit 21.0.3** +- **Gradle 8.8** See [GUIDELINES.md](GUIDELINES.md#61-required-programs) to learn how to install and configure these tools. diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f..8b437bdea 100755 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e34986c96..a4413138c 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Tue Apr 25 10:29:27 CEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c78733..b740cf133 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +214,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd32c..25da30dbd 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/itachallenge-auth/src/main/resources/application.yml b/itachallenge-auth/src/main/resources/application.yml index 49cca4584..f8b61d837 100755 --- a/itachallenge-auth/src/main/resources/application.yml +++ b/itachallenge-auth/src/main/resources/application.yml @@ -1,7 +1,7 @@ spring: application: name: itachallenge-auth - version: 1.0.0-RELEASE + version: 2.0.0-RELEASE autoconfigure: exclude: - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration diff --git a/itachallenge-challenge/build.gradle b/itachallenge-challenge/build.gradle index ec9c07cfe..a38bed42b 100755 --- a/itachallenge-challenge/build.gradle +++ b/itachallenge-challenge/build.gradle @@ -25,10 +25,10 @@ repositories { dependencies { - compileOnly 'org.projectlombok:lombok:1.18.26' - annotationProcessor 'org.projectlombok:lombok:1.18.26' - testCompileOnly 'org.projectlombok:lombok:1.18.26' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.26' + compileOnly 'org.projectlombok:lombok:1.18.30' + annotationProcessor 'org.projectlombok:lombok:1.18.30' + testCompileOnly 'org.projectlombok:lombok:1.18.30' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.30' implementation 'org.springframework.boot:spring-boot-autoconfigure:3.0.6' implementation 'org.springframework.cloud:spring-cloud-commons:4.0.1' diff --git a/itachallenge-challenge/src/main/resources/application.yml b/itachallenge-challenge/src/main/resources/application.yml index 61a7a50d1..95ee73e29 100755 --- a/itachallenge-challenge/src/main/resources/application.yml +++ b/itachallenge-challenge/src/main/resources/application.yml @@ -1,7 +1,7 @@ spring: application: name: itachallenge-challenge - version: 1.7.0-RELEASE + version: 2.0.0-RELEASE autoconfigure: exclude: - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration diff --git a/itachallenge-document/src/main/resources/application.yml b/itachallenge-document/src/main/resources/application.yml index ccf993f75..339560380 100755 --- a/itachallenge-document/src/main/resources/application.yml +++ b/itachallenge-document/src/main/resources/application.yml @@ -1,7 +1,7 @@ spring: application: name: itachallenge-document - version: 1.1.0-RELEASE + version: 2.0.0-RELEASE autoconfigure: exclude: diff --git a/itachallenge-mock/src/main/resources/application.yml b/itachallenge-mock/src/main/resources/application.yml index a3e70ad59..f65e14254 100755 --- a/itachallenge-mock/src/main/resources/application.yml +++ b/itachallenge-mock/src/main/resources/application.yml @@ -1,7 +1,7 @@ spring: application: name: itachallenge-mock - version: 1.0.1-RELEASE + version: 2.0.0-RELEASE springdoc: diff --git a/itachallenge-score/build.gradle b/itachallenge-score/build.gradle index 1bc0112f4..6096888c4 100755 --- a/itachallenge-score/build.gradle +++ b/itachallenge-score/build.gradle @@ -30,8 +30,8 @@ dependencies { implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive:3.0.4' implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation 'org.projectlombok:lombok:1.18.20' - annotationProcessor 'org.projectlombok:lombok:1.18.20' + implementation 'org.projectlombok:lombok:1.18.30' + annotationProcessor 'org.projectlombok:lombok:1.18.30' implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' implementation 'javax.validation:validation-api:2.0.1.Final' implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.1.0' diff --git a/itachallenge-score/src/main/java/com/itachallenge/score/controller/ScoreController.java b/itachallenge-score/src/main/java/com/itachallenge/score/controller/ScoreController.java index 4b1e3cdd4..1414f4eb9 100755 --- a/itachallenge-score/src/main/java/com/itachallenge/score/controller/ScoreController.java +++ b/itachallenge-score/src/main/java/com/itachallenge/score/controller/ScoreController.java @@ -7,7 +7,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*;; +import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Mono; import java.util.HashMap; diff --git a/itachallenge-score/src/main/resources/application.yml b/itachallenge-score/src/main/resources/application.yml index 1821eaa16..0df3be704 100755 --- a/itachallenge-score/src/main/resources/application.yml +++ b/itachallenge-score/src/main/resources/application.yml @@ -1,7 +1,7 @@ spring: application: name: itachallenge-score - version: 1.0.0-RELEASE + version: 2.0.0-RELEASE jmx: enabled: true diff --git a/itachallenge-user/build.gradle b/itachallenge-user/build.gradle index 941df79c3..3dd87cb8e 100755 --- a/itachallenge-user/build.gradle +++ b/itachallenge-user/build.gradle @@ -31,8 +31,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-mongodb:3.0.6' implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive:3.0.6' implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation 'org.projectlombok:lombok:1.18.20' - annotationProcessor 'org.projectlombok:lombok:1.18.20' + implementation 'org.projectlombok:lombok:1.18.30' + annotationProcessor 'org.projectlombok:lombok:1.18.30' implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' implementation 'javax.validation:validation-api:2.0.1.Final' implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.1.0' diff --git a/itachallenge-user/src/main/resources/application.yml b/itachallenge-user/src/main/resources/application.yml index a5cf43fcb..c5dc93af0 100755 --- a/itachallenge-user/src/main/resources/application.yml +++ b/itachallenge-user/src/main/resources/application.yml @@ -1,7 +1,7 @@ spring: application: name: itachallenge-user - version: 1.0.0-RELEASE + version: 2.0.0-RELEASE autoconfigure: exclude: - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration diff --git a/itachallenge-user/src/main/resources/mongodb-test-data/solutions.json b/itachallenge-user/src/main/resources/mongodb-test-data/solutions.json index 2f097daa6..0b92a4c38 100755 --- a/itachallenge-user/src/main/resources/mongodb-test-data/solutions.json +++ b/itachallenge-user/src/main/resources/mongodb-test-data/solutions.json @@ -8,7 +8,7 @@ "language_id": { "$uuid": "1e047ea2-b787-49e7-acea-d79e92be3909"}, "bookmarked": true, "status": "ENDED", - "score": 95, + "score": 100, "solution":[ { "_id" : { @@ -27,7 +27,7 @@ "language_id": { "$uuid": "09fabe32-7362-4bfb-ac05-b7bf854c6e0f"}, "bookmarked": true, "status": "STARTED", - "score": 60, + "score": 0, "solution":[ { "_id" : { @@ -46,7 +46,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": false, "status": "STARTED", - "score": 67, + "score": 0, "solution":[ { "_id" : { @@ -65,7 +65,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "ENDED", - "score": 63, + "score": 100, "solution":[ { "_id" : { @@ -84,7 +84,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": false, "status": "STARTED", - "score": 66, + "score": 0, "solution":[ { "_id" : { @@ -103,7 +103,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f'"}, "bookmarked": false, "status": "STARTED", - "score": 69, + "score": 0, "solution":[ { "_id" : { @@ -122,7 +122,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "STARTED", - "score": 66, + "score": 0, "solution":[ { "_id" : { @@ -141,7 +141,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "ENDED", - "score": 74, + "score": 100, "solution":[ { "_id" : { @@ -160,7 +160,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "STARTED", - "score": 63, + "score": 0, "solution":[ { "_id" : { @@ -179,7 +179,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "STARTED", - "score": 92, + "score": 0, "solution":[ { "_id" : { @@ -198,7 +198,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "ENDED", - "score": 94, + "score": 0, "solution":[ { "_id" : { @@ -217,7 +217,7 @@ "language_id": { "$uuid": "1e047ea2-b787-49e7-acea-d79e92be3909"}, "bookmarked": true, "status": "STARTED", - "score": 74, + "score": 0, "solution":[ { "_id" : { @@ -236,7 +236,7 @@ "language_id": { "$uuid": "09fabe32-7362-4bfb-ac05-b7bf854c6e0f"}, "bookmarked": false, "status": "STARTED", - "score": 81, + "score": 0, "solution":[ { "_id" : { @@ -255,7 +255,7 @@ "language_id": { "$uuid": "409c9fe8-74de-4db3-81a1-a55280cf92ef"}, "bookmarked": false, "status": "STARTED", - "score": 88, + "score": 0, "solution":[ { "_id" : { @@ -274,7 +274,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "STARTED", - "score": 97, + "score": 0, "solution":[ { "_id" : { @@ -293,7 +293,7 @@ "language_id": { "$uuid": "09fabe32-7362-4bfb-ac05-b7bf854c6e0f"}, "bookmarked": true, "status": "STARTED", - "score": 76, + "score": 0, "solution":[ { "_id" : { @@ -312,7 +312,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "STARTED", - "score": 79, + "score": 0, "solution":[ { "_id" : { @@ -331,7 +331,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "EMPTY", - "score": 73, + "score": 0, "solution":[ { "_id" : { @@ -350,7 +350,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "EMPTY", - "score": 71, + "score": 0, "solution":[ { "_id" : { @@ -369,7 +369,7 @@ "language_id": { "$uuid": "1e047ea2-b787-49e7-acea-d79e92be3909"}, "bookmarked": false, "status": "STARTED", - "score": 85, + "score": 0, "solution":[ { "_id" : { @@ -388,7 +388,7 @@ "language_id": { "$uuid": "09fabe32-7362-4bfb-ac05-b7bf854c6e0f"}, "bookmarked": true, "status": "STARTED", - "score": 86, + "score": 0, "solution":[ { "_id" : { @@ -407,7 +407,7 @@ "language_id": { "$uuid": "409c9fe8-74de-4db3-81a1-a55280cf92ef"}, "bookmarked": true, "status": "ENDED", - "score": 67, + "score": 100, "solution":[ { "_id" : { @@ -426,7 +426,7 @@ "language_id": { "$uuid": "660e1b18-0c0a-4262-a28a-85de9df6ac5f"}, "bookmarked": true, "status": "STARTED", - "score": 91, + "score": 0, "solution":[ { "_id" : {