Skip to content

Commit

Permalink
DIAC-556 dependency-check-update (#2286)
Browse files Browse the repository at this point in the history
* DIAC-556-dependency-check-update

* change lombok to v6.6.3

* add lombok compileOnly and annotationProcessor

* Update sonarqube

* Update pmd

* remove comments
  • Loading branch information
AmandaRichards authored Aug 8, 2024
1 parent db4b8c7 commit 7e17b6f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 37 deletions.
29 changes: 12 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ plugins {
id "info.solidsoft.pitest" version '1.9.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.flywaydb.flyway' version '5.2.4'
id 'org.owasp.dependencycheck' version '9.0.5'
id 'org.sonarqube' version '3.0'
id 'org.owasp.dependencycheck' version '10.0.3'
id 'org.sonarqube' version '4.3.0.3225'
id 'org.springframework.boot' version '2.7.18'
id 'uk.gov.hmcts.java' version '0.12.43'
id 'au.com.dius.pact' version '4.2.14'
id "io.freefair.lombok" version "6.2.0"
id "io.freefair.lombok" version "6.6.3"
}

apply plugin: 'java'
Expand Down Expand Up @@ -128,12 +128,6 @@ processFunctionalTestResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

lombok {
config['config.stopbubbling'] = 'true'
config['lombok.addLombokGeneratedAnnotation'] = 'true'
config['lombok.anyConstructor.addConstructorProperties'] = 'true'
}

idea {
module {
testSourceDirs += project.sourceSets.integrationTest.java.srcDirs
Expand Down Expand Up @@ -164,7 +158,7 @@ checkstyle {
}

pmd {
toolVersion = '6.41.0'
toolVersion = '7.0.0'
ignoreFailures = true
sourceSets = [sourceSets.main, sourceSets.test, sourceSets.integrationTest, sourceSets.functionalTest, sourceSets.smokeTest]
reportsDir = file("$project.buildDir/reports/pmd")
Expand Down Expand Up @@ -224,9 +218,9 @@ jacoco {
jacocoTestReport {
executionData(test, integration)
reports {
xml.required = true
csv.required = false
xml.getOutputLocation().set(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"))
}
}

Expand All @@ -252,7 +246,7 @@ sonarqube {
properties {
property "sonar.projectName", "IA :: Immigration & Asylum case api"
property "sonar.projectKey", "IACASEAPI"
property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml"
property "sonar.coverage.jacoco.xmlReportPaths", layout.buildDirectory.file("reports/jacoco/test/jacocoTestReport.xml").get().asFile
property "sonar.pitest.mode", "reuseReport"
property "sonar.pitest.reportsDirectory", "build/reports/pitest"
property "sonar.exclusions", "src/main/java/uk/gov/hmcts/reform/iacaseapi/infrastructure/config/**," +
Expand Down Expand Up @@ -386,9 +380,10 @@ dependencies {
implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.74'
implementation group: 'uk.gov.service.notify', name: 'notifications-java-client', version: '5.0.1-RELEASE'

compileOnly 'org.projectlombok:lombok'

annotationProcessor 'org.projectlombok:lombok'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.30'

implementation group: 'org.springframework.retry', name: 'spring-retry', version: '1.3.3'
implementation group: 'org.springframework.security', name: 'spring-security-crypto'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,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 "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +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=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 @@ -198,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
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ 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.
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

Expand All @@ -57,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

Expand Down

0 comments on commit 7e17b6f

Please sign in to comment.