From e5db4345a986c30288a4aa16c7a28b6212fba0bd Mon Sep 17 00:00:00 2001 From: Imran Ali <101260174+justiceia@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:25:46 +0100 Subject: [PATCH] FACT-1798 changes for 17 to 21 (#3333) * FACT-1798 changes for 17 to 21 * changed workflow and readme --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-openapi.yaml | 2 +- Dockerfile | 4 ++-- README.md | 2 +- build.gradle | 14 +++++++------- gradle/wrapper/gradle-wrapper.properties | 3 ++- src/test/resources/application.yaml | 9 +++++++++ 7 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 src/test/resources/application.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a537166de..6ad942e01d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/publish-openapi.yaml b/.github/workflows/publish-openapi.yaml index 3f6380ec4d..fbb150d0c7 100644 --- a/.github/workflows/publish-openapi.yaml +++ b/.github/workflows/publish-openapi.yaml @@ -11,4 +11,4 @@ jobs: SWAGGER_PUBLISHER_API_TOKEN: ${{ secrets.SWAGGER_PUBLISHER_API_TOKEN }} with: test_to_run: 'uk.gov.hmcts.reform.bulkscanprocessor.config.SwaggerPublisher' - java_version: 17 \ No newline at end of file + java_version: 21 diff --git a/Dockerfile b/Dockerfile index b6cef3b7a5..9153864b1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG APP_INSIGHTS_AGENT_VERSION=3.4.8 +ARG APP_INSIGHTS_AGENT_VERSION=3.5.2 -FROM hmctspublic.azurecr.io/base/java:17-distroless +FROM hmctspublic.azurecr.io/base/java:21-distroless COPY lib/applicationinsights.json /opt/app/ diff --git a/README.md b/README.md index 4e5c064aad..437a7418fe 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ services fetch the new data. ## Getting Started ### Prerequisites -- [JDK 17](https://www.oracle.com/java) +- [JDK 21](https://www.oracle.com/java) - Project requires Spring Boot v3.x to be present ### Installation diff --git a/build.gradle b/build.gradle index 4f47ecd2be..7bfca9a841 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ plugins { id 'org.springframework.boot' version '3.3.3' id 'org.owasp.dependencycheck' version '9.1.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 'info.solidsoft.pitest' version '1.15.0' id 'au.com.dius.pact' version '4.3.14' } @@ -29,7 +29,7 @@ version = '0.1.0' // all the time it was 0.0.1. 0.1.0 marks migration to java 11 java { toolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(21) } } @@ -131,7 +131,7 @@ pmd { toolVersion = "6.55.0" ignoreFailures = 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 ruleSetFiles = files("config/pmd/ruleset.xml") ruleSets = [] } @@ -139,9 +139,9 @@ pmd { jacocoTestReport { executionData(test, integration) reports { - xml.enabled = true - csv.enabled = false - xml.destination = file("${project.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 { @@ -193,7 +193,7 @@ pitest { sonarqube { properties { property "sonar.projectName", "Reform :: Bulk Scan Processor" - property "sonar.coverage.jacoco.xmlReportPaths", jacocoTestReport.reports.xml.destination.path + property "sonar.coverage.jacoco.xmlReportPaths", jacocoTestReport.reports.xml.outputLocation.get().asFile.absolutePath property "sonar.pitest.mode", "reuseReport" property "sonar.pitest.reportsDirectory", "build/reports/pitest" property "sonar.exclusions", "**/model/out/*,**/config/**,**/LeaseAcquirer.java" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c7d437bbb4..b82aa23a4f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/test/resources/application.yaml b/src/test/resources/application.yaml new file mode 100644 index 0000000000..6e48b5fbc7 --- /dev/null +++ b/src/test/resources/application.yaml @@ -0,0 +1,9 @@ + +case_document_am: + url: ${CASE_DOCUMENT_AM_URL:http://localhost:4452} + +idam: + api: + url: ${IDAM_API_URL:http://localhost:4501} + s2s-auth: + url: ${S2S_URL:http://localhost:4552}