Skip to content

Commit

Permalink
Merge pull request #229 from project-next/release
Browse files Browse the repository at this point in the history
v1.5.0: Updating Java Version (20 to Java 21)
  • Loading branch information
rtomyj authored Nov 18, 2023
2 parents 3b1e0c0 + 3fb99aa commit aeaf75c
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 40 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,30 @@ on:
- opened
- edited
- reopened
- synchronize

jobs:
build-and-junits:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v3.13.0
with:
java-version: '20'
java-version: '21'
distribution: 'temurin'
cache: 'gradle'

- name: Execute Gradle Build
uses: gradle/gradle-build-action@v2.7.1
uses: gradle/gradle-build-action@v2.9.0
with:
gradle-version: wrapper
arguments: build

- name: Upload Results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v3.1.3
with:
name: junit-results
path: |
Expand Down
38 changes: 19 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar

// main
val romeToolsVersion = "2.1.0"
val springBootVersion = "3.1.3"
val jacksonKotlinVersion = "2.15.2"
val jacksonCoreVersion = "2.15.2"
val snakeYamlVersion = "2.1"
val springBootVersion = "3.1.5"
val jacksonKotlinVersion = "2.16.0"
val jacksonCoreVersion = "2.16.0"
val snakeYamlVersion = "2.2"
val kotlinVersion = "1.7.22"
val postgresqlVersion = "42.6.0"
val slf4jVersion = "2.0.7"
val jCacheVersion = "6.2.7.Final"
val slf4jVersion = "2.0.9"
val jCacheVersion = "6.3.1.Final"
val ehCacheVersion = "3.10.8"

val archivesBaseName = "podcast-api"

plugins {
id("org.springframework.boot") version "3.1.3"
id("io.spring.dependency-management") version "1.1.3"
id("info.solidsoft.pitest") version "1.9.11"
id("com.adarshr.test-logger") version "3.2.0" // printing for JUnits
id("org.springframework.boot") version "3.1.5"
id("io.spring.dependency-management") version "1.1.4"
id("info.solidsoft.pitest") version "1.15.0"
id("com.adarshr.test-logger") version "4.0.0" // printing for JUnits
// id("org.graalvm.buildtools.native") version "0.9.18" // - native

kotlin("jvm") version "1.9.10"
kotlin("plugin.spring") version "1.9.10"
kotlin("jvm") version "1.9.20"
kotlin("plugin.spring") version "1.9.20"

jacoco
}


group = "com.rtomyj.next"
version = "1.4.3"
java.sourceCompatibility = JavaVersion.VERSION_20
version = "1.5.0"
java.sourceCompatibility = JavaVersion.VERSION_21


repositories {
Expand Down Expand Up @@ -101,7 +101,7 @@ apply(from = "gradle/unitTest.gradle.kts")
tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_20.toString()
jvmTarget = JavaVersion.VERSION_21.toString()
}
}

Expand Down Expand Up @@ -129,7 +129,7 @@ tasks {
description = "Specifies the absolute path of the JAR created by the bootJar task."

doFirst {
println("$buildDir/libs/$archivesBaseName-${project.version}.jar")
println("${layout.buildDirectory.get()}/libs/$archivesBaseName-${project.version}.jar")
}
}

Expand All @@ -139,8 +139,8 @@ tasks {

dependsOn(bootJar)

from("${buildDir}/libs/${archivesBaseName}-${project.version}.jar")
into("${buildDir}/libs")
from("${layout.buildDirectory.get()}/libs/${archivesBaseName}-${project.version}.jar")
into("${layout.buildDirectory.get()}/libs")

rename("${archivesBaseName}-${project.version}.jar", "${archivesBaseName}.jar")
}
Expand Down Expand Up @@ -168,5 +168,5 @@ pitest {
}

jacoco {
toolVersion = "0.8.10"
toolVersion = "0.8.11"
}
2 changes: 1 addition & 1 deletion docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.9'

services:
podcast-api:
image: "eclipse-temurin:20.0.1_9-jre-alpine"
image: "eclipse-temurin:21.0.1_12-jre-alpine"
ports:
- "9001:8080"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.9'

services:
podcast-api:
image: "eclipse-temurin:20.0.1_9-jre-alpine"
image: "eclipse-temurin:21.0.1_12-jre-alpine"
ports:
- "80:8080"
volumes:
Expand Down
1 change: 1 addition & 0 deletions docker-restage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ ssh -y -i ~/.ssh/podcast-api-server.pem "${user}@${server}" << EOF
cd ~/api/podcast-api
docker-compose kill
docker-compose rm -f
docker-compose pull
docker-compose up --scale podcast-api=1 -d
EOF
6 changes: 3 additions & 3 deletions gradle/unitTest.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
val springVersion = "3.1.3"
val springVersion = "3.1.5"
val mockitKotlinVersion = "1.6.0"
val h2Version = "2.2.220"
val h2Version = "2.2.224"

dependencies {
"testImplementation"(kotlin("test"))

"testImplementation"("com.nhaarman:mockito-kotlin:$mockitKotlinVersion") // provides helper functions needed for mockito to work in Kotlin
"testImplementation"("org.springframework.boot:spring-boot-starter-test:$springVersion")
"testImplementation"("org.springframework.security:spring-security-test:6.1.3")
"testImplementation"("org.springframework.security:spring-security-test:6.1.5")

"testRuntimeOnly"("com.h2database:h2:$h2Version")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ 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
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=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ 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, 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" \
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/rtomyj/podcast/service/PodcastService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PodcastService @Autowired constructor(
companion object {
private val log = LoggerFactory.getLogger(this::class.java.name)

private const val SQLExceptionLog = "SQLException occurred while inserting new podcast info. {}"
private const val SQL_EXCEPTION_LOG = "SQLException occurred while inserting new podcast info. {}"
private const val PODCAST_ID_NOT_FOUND = "Podcast ID not found in DB"
private const val EPISODE_ID_NOT_FOUND = "Episode ID not found in DB"
private const val SOMETHING_WENT_WRONG = "Something went wrong!"
Expand Down Expand Up @@ -82,7 +82,7 @@ class PodcastService @Autowired constructor(
try {
podcastCrudRepository.save(podcast)
} catch (ex: DataAccessException) {
log.error(SQLExceptionLog, ex.toString())
log.error(SQL_EXCEPTION_LOG, ex.toString())
throw PodcastException(SOMETHING_WENT_WRONG, ErrorType.DB003)
}
}
Expand Down Expand Up @@ -139,7 +139,7 @@ class PodcastService @Autowired constructor(
try {
podcastEpisodePagingAndSortingRepository.save(podcastEpisode)
} catch (ex: DataAccessException) {
log.error(SQLExceptionLog, ex.toString())
log.error(SQL_EXCEPTION_LOG, ex.toString())
throw PodcastException(SOMETHING_WENT_WRONG, ErrorType.DB003)
}
}
Expand Down

0 comments on commit aeaf75c

Please sign in to comment.