diff --git a/build.gradle b/build.gradle index cbd2bab9..0ed6b570 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ // custom configuration and dependencies are moved to buildSrc -// dependabot probably wont work with such configuration +// dependabot probably won't work with such configuration plugins { id 'spotless-conventions' @@ -11,7 +11,7 @@ ext { // doesn't work in build.gradle in buildSrc project ext { - springCloudDependencies = "org.springframework.cloud:spring-cloud-dependencies:2025.1.0" + springCloudDependencies = "org.springframework.cloud:spring-cloud-dependencies:2025.1.1" } //share project version between all projects diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1ebcb32d..a81d4601 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -10,9 +10,9 @@ repositories { // dependency for spring boot gradle plugin and dependency management. // It is necessary to share it between conventions as plugins dependencies { - implementation 'org.springframework.boot:spring-boot-gradle-plugin:4.0.1' + implementation 'org.springframework.boot:spring-boot-gradle-plugin:4.0.2' implementation 'io.spring.gradle:dependency-management-plugin:1.1.7' - implementation 'com.diffplug.spotless:spotless-lib:4.1.0' - implementation 'com.diffplug.spotless:spotless-plugin-gradle:8.1.0' + implementation 'com.diffplug.spotless:spotless-lib:4.3.0' + implementation 'com.diffplug.spotless:spotless-plugin-gradle:8.2.1' runtimeOnly 'com.google.protobuf:protobuf-gradle-plugin:0.9.6' } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79..61285a65 100644 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 cd4b7aa8..78dfb562 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb..adff685a 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/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/. @@ -83,7 +85,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -111,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -130,10 +132,13 @@ 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. @@ -141,7 +146,7 @@ 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=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +154,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -166,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -198,16 +202,15 @@ fi # 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, 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. +# Collect all arguments for the java command: +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f..e509b2dd 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,92 +1,93 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -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. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -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. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -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! -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 - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +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 + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +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 + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +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! +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 + +:omega diff --git a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/Chat.java b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/Chat.java index 89866571..2fcbf288 100644 --- a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/Chat.java +++ b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/Chat.java @@ -26,7 +26,7 @@ public class Chat { @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; - @Column(name = "chat_id") + @Column(name = "chat_id", nullable = false) private long chatId; @Column(name = "type") @@ -44,7 +44,7 @@ public class Chat { @Column(name = "username") private String username; - @Column(name = "active") + @Column(name = "active", nullable = false) private boolean active; @Column(name = "message_thread_id") diff --git a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/registry/SentCoubsRegistry.java b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/registry/SentCoubsRegistry.java index 6e4411cd..d10730b2 100644 --- a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/registry/SentCoubsRegistry.java +++ b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/registry/SentCoubsRegistry.java @@ -44,9 +44,9 @@ public class SentCoubsRegistry { @JoinColumn(name = "subscription_id") private Subscription subscription; - @Column(name = "coub_permalink") + @Column(name = "coub_permalink", nullable = false) private String coubPermalink; - @Column(name = "date_time") + @Column(name = "date_time", nullable = false) private LocalDateTime dateTime; } diff --git a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Community.java b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Community.java index c25226e6..648fb724 100644 --- a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Community.java +++ b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Community.java @@ -36,7 +36,7 @@ public class Community { @Column(name = "external_id") private long externalId; - @Column(name = "name") + @Column(name = "name", nullable = false) private String name; @BatchSize(size = 10) // not necessary if entity graph is used diff --git a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Section.java b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Section.java index 2e7fcaae..e6bdaf39 100644 --- a/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Section.java +++ b/subscriptions_holder/src/main/java/ru/dankoy/subscriptionsholder/subscriptions_holder/core/domain/subscriptions/community/Section.java @@ -26,7 +26,7 @@ public class Section { @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; - @Column(name = "name") + @Column(name = "name", nullable = false) private String name; @Override diff --git a/telegram_bot/build.gradle b/telegram_bot/build.gradle index e6ab5a78..2c215ac2 100644 --- a/telegram_bot/build.gradle +++ b/telegram_bot/build.gradle @@ -28,13 +28,13 @@ dependencies { // bot - doesn't work with eureka client // adds core bot functionality - implementation('org.telegram:telegrambots-longpolling:9.2.1') { + implementation('org.telegram:telegrambots-longpolling:9.3.0') { exclude group: 'org.glassfish.jersey.containers' exclude group: 'org.glassfish.jersey.core' exclude group: 'org.glassfish.jersey.inject' exclude group: 'org.glassfish.jersey.media' } - implementation('org.telegram:telegrambots-client:9.2.1') // adds client to communicate with telegram api + implementation('org.telegram:telegrambots-client:9.3.0') // adds client to communicate with telegram api // freemarker implementation 'org.springframework.boot:spring-boot-starter-freemarker' diff --git a/telegram_chat_service/build.gradle b/telegram_chat_service/build.gradle index 7bddf8d0..586d00b5 100644 --- a/telegram_chat_service/build.gradle +++ b/telegram_chat_service/build.gradle @@ -5,7 +5,7 @@ buildscript { classpath files('jasypt-encrypt-plugin-1.3.3.jar') classpath files('jooq-codegen-gradle-3.19.29.jar') // update only if starter updated it classpath("org.testcontainers:testcontainers-postgresql:2.0.3") - classpath("org.postgresql:postgresql:42.7.8") + classpath("org.postgresql:postgresql:42.7.9") classpath("org.liquibase:liquibase-gradle-plugin:3.0.2") classpath('org.liquibase:liquibase-core:5.0.1') } @@ -201,7 +201,7 @@ jooq { directory = "src/main/java/" } - // generates in build folder. Add sourceSets{} see below + add classpth to vscode ot idea + // generates in build folder. Add sourceSets{} see below + add classpth to vscode or idea // target { // packageName = "ru.dankoy.telegramchatservice.jooq" // directory = "${project.buildDir}/generated/sources/java/main/"