Skip to content

Commit

Permalink
FACT-1797 java 17 to 21 (#2268)
Browse files Browse the repository at this point in the history
* 17 to 21

* added replacement lines

* added application.yaml for unit tests

* changed workflow section
  • Loading branch information
justiceia authored Sep 26, 2024
1 parent c9a195b commit c040355
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
- name: Run checks
run: ./gradlew check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
SWAGGER_PUBLISHER_API_TOKEN: ${{ secrets.SWAGGER_PUBLISHER_API_TOKEN }}
with:
test_to_run: 'uk.gov.hmcts.reform.blobrouter.config.SwaggerPublisher'
java_version: 17
java_version: 21
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG APP_INSIGHTS_AGENT_VERSION=3.5.2

# Application image

FROM hmctspublic.azurecr.io/base/java:17-distroless
FROM hmctspublic.azurecr.io/base/java:21-distroless

COPY build/libs/blob-router-service.jar /opt/app/
COPY lib/applicationinsights.json /opt/app/
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
id 'org.springframework.boot' version '3.3.3'
id 'org.owasp.dependencycheck' version '9.2.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.sonarqube' version '4.4.1.3373'
id 'org.sonarqube' version '5.0.0.4638'
id 'org.flywaydb.flyway' version "$flywayVersion"
}

Expand All @@ -27,7 +27,7 @@ version = '0.0.1'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand Down Expand Up @@ -117,7 +117,7 @@ pmd {
ignoreFailures = true
incrementalAnalysis = true
sourceSets = [sourceSets.main, sourceSets.test, sourceSets.functionalTest, sourceSets.integrationTest, sourceSets.smokeTest]
reportsDir = file("$project.buildDir/reports/pmd")
reportsDir = layout.buildDirectory.dir("reports/pmd").get().asFile
// https://github.com/pmd/pmd/issues/876
ruleSets = []
ruleSetFiles = files("config/pmd/ruleset.xml")
Expand All @@ -126,9 +126,9 @@ pmd {
jacocoTestReport {
executionData(test, integration)
reports {
xml.enabled = true
csv.enabled = false
xml.destination = file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
xml.required.set(true)
csv.required.set(false)
xml.outputLocation.set(layout.buildDirectory.file("reports/jacoco/test/jacocoTestReport.xml"))
}
afterEvaluate {
getClassDirectories().from = getClassDirectories().files.collect {
Expand All @@ -146,7 +146,7 @@ sonarqube {
properties {
property "sonar.projectName", "Reform :: blob-router-service"
property "sonar.projectKey", "uk.gov.hmcts.reform:blob-router-service"
property "sonar.coverage.jacoco.xmlReportPaths", jacocoTestReport.reports.xml.destination.path
property "sonar.coverage.jacoco.xmlReportPaths", jacocoTestReport.reports.xml.outputLocation.get().asFile.absolutePath
property 'sonar.exclusions', "**/config/**,**/data/model/**,**/reconciliation/model/**,**/jms/**"
}
}
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
validateDistributionUrl=true
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 7 additions & 0 deletions src/test/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bulk-scan-processor-url: ${PROCESSOR_URL:AAAAAAAA}

pcq-backend-api-url: ${PCQ_BACKEND_API_URL:AAAAAAAA}

idam:
s2s-auth:
url: ${S2S_URL:http://localhost:4552}

0 comments on commit c040355

Please sign in to comment.