diff --git a/azure/pom.xml b/azure/pom.xml index d548fb9..648cdc6 100644 --- a/azure/pom.xml +++ b/azure/pom.xml @@ -2,14 +2,14 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Azure - 4.0.19-SNAPSHOT + tracesx-springboot-common-azure + 4.0.26-SNAPSHOT azure uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT diff --git a/event/pom.xml b/event/pom.xml index 2680e19..5166264 100644 --- a/event/pom.xml +++ b/event/pom.xml @@ -2,14 +2,14 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Event - 4.0.19-SNAPSHOT + tracesx-springboot-common-event + 4.0.26-SNAPSHOT event uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT diff --git a/health-tests/pom.xml b/health-tests/pom.xml index 38577c7..be015c6 100644 --- a/health-tests/pom.xml +++ b/health-tests/pom.xml @@ -2,8 +2,8 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Health-Tests - 4.0.19-SNAPSHOT + tracesx-springboot-common-health-tests + 4.0.26-SNAPSHOT health-tests An integration test library for testing correct deployment of the Shared Spring Boot health Configuration @@ -11,8 +11,8 @@ uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT diff --git a/health/pom.xml b/health/pom.xml index adcfcc2..698e062 100644 --- a/health/pom.xml +++ b/health/pom.xml @@ -2,14 +2,14 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Health - 4.0.19-SNAPSHOT + tracesx-springboot-common-health + 4.0.26-SNAPSHOT health uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT diff --git a/logging/pom.xml b/logging/pom.xml index a5d36b2..bd468b1 100644 --- a/logging/pom.xml +++ b/logging/pom.xml @@ -2,14 +2,14 @@ 4.0.0 - TracesX-SpringBoot-Common-Logging - 4.0.19-SNAPSHOT + tracesx-springboot-common-logging + 4.0.26-SNAPSHOT logging uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT diff --git a/parent/pom.xml b/parent/pom.xml index 7792af8..6052ab3 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -2,8 +2,8 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Parent - 4.0.19-SNAPSHOT + tracesx-springboot-common-parent + 4.0.26-SNAPSHOT pom parent @@ -12,19 +12,15 @@ org.springframework.boot spring-boot-starter-parent - 3.5.5 + 3.5.14 + - - release - Snapshots - https://artifactoryv2.azure.defra.cloud/artifactory/maven-snapshots-local - - release - Releases - ${repo.releases.url} + github + GitHub Packages + https://maven.pkg.github.com/DEFRA/ipaffs-spring-boot-common @@ -41,7 +37,7 @@ ie it will get bumped/have -SNAPSHOT added/removed when the main build runs on the CI server --> - 4.0.19-SNAPSHOT + 4.0.26-SNAPSHOT 21 @@ -82,42 +78,42 @@ uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Azure + tracesx-springboot-common-azure ${tracesx.springboot.common.version} uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Event + tracesx-springboot-common-event ${tracesx.springboot.common.version} uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Health + tracesx-springboot-common-health ${tracesx.springboot.common.version} uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Health-Tests + tracesx-springboot-common-health-tests ${tracesx.springboot.common.version} uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Logging + tracesx-springboot-common-logging ${tracesx.springboot.common.version} uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Security + tracesx-springboot-common-security ${tracesx.springboot.common.version} uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Security-Tests + tracesx-springboot-common-security-tests ${tracesx.springboot.common.version} uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Version + tracesx-springboot-common-version ${tracesx.springboot.common.version} diff --git a/pipeline.yaml b/pipeline.yaml new file mode 100644 index 0000000..737788c --- /dev/null +++ b/pipeline.yaml @@ -0,0 +1,76 @@ +trigger: + branches: + include: + - '*' + +pr: + branches: + exclude: + - '*' + +pool: + name: 'DEFRA-COMMON-UBUNTU-SSV5' + +jobs: + - job: Release + displayName: Release + condition: and(not(failed()), not(canceled()), ne(variables['Build.SourceBranch'], 'refs/heads/main')) + variables: + MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository + MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' + steps: + - checkout: self + persistCredentials: true + fetchDepth: 0 + + - script: | + git checkout $(Build.SourceBranchName) + displayName: Checkout branch + + - script: | + LAST_COMMIT_MESSAGE="$(git log -1 --pretty=%B)" + echo "Last commit message: $LAST_COMMIT_MESSAGE" + + if [[ "$LAST_COMMIT_MESSAGE" == *"maven-release-plugin"* ]] || \ + [[ "$LAST_COMMIT_MESSAGE" == *"bump-new-npm-version"* ]]; then + echo "Previous commit was a release commit. Skipping Maven release." + echo "##vso[task.setvariable variable=skipRelease]true" + else + echo "##vso[task.setvariable variable=skipRelease]false" + fi + displayName: Check last commit message + + + - script: | + git config user.email "imports-jenkins@defra.onmicrosoft.com" + git config user.name "imports-jenkins" + displayName: "Git author" + + + - task: DownloadSecureFile@1 + name: mavenSettings + displayName: 'Download Maven Settings' + inputs: + secureFile: 'maven.xml' + + - task: Cache@2 + inputs: + key: 'maven | "$(Agent.OS)" | **/pom.xml' + restoreKeys: | + maven | "$(Agent.OS)" + maven + path: $(MAVEN_CACHE_FOLDER) + displayName: Cache Maven local repo + + - task: Maven@4 + displayName: 'Release' + condition: and(succeeded(), ne(variables['skipRelease'], 'true')) + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx512m $(MAVEN_OPTS)' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.21' + jdkArchitectureOption: 'x64' + options: '--s $(mavenSettings.secureFilePath)' + goals: '--batch-mode clean test package release:prepare release:perform' + diff --git a/pom.xml b/pom.xml index 4fc7786..36c5a22 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,8 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT pom Shared Spring Boot: Common Libraries Parent and Aggregator Module common-parent @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-dependencies - 3.5.5 + 3.5.14 @@ -68,7 +68,7 @@ - + + + github + GitHub Packages + https://maven.pkg.github.com/DEFRA/ipaffs-spring-boot-common diff --git a/security-tests/pom.xml b/security-tests/pom.xml index 9a2eeae..4ac6ccc 100644 --- a/security-tests/pom.xml +++ b/security-tests/pom.xml @@ -2,25 +2,17 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Security-Tests - 4.0.19-SNAPSHOT + tracesx-springboot-common-security-tests + 4.0.26-SNAPSHOT security-tests An integration test library for testing correct deployment of the Shared Spring Boot Web Security Configuration uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT - - - release - Releases - ${repo.releases.url} - - - ${parent.scm.connection} HEAD diff --git a/security/pom.xml b/security/pom.xml index b3e9b26..f3648a5 100644 --- a/security/pom.xml +++ b/security/pom.xml @@ -2,15 +2,15 @@ 4.0.0 uk.gov.defra.tracesx - TracesX-SpringBoot-Common-Security - 4.0.19-SNAPSHOT + tracesx-springboot-common-security + 4.0.26-SNAPSHOT security Shared Spring Boot Web Security configuration uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT diff --git a/security/src/main/java/uk/gov/defra/tracesx/common/security/jwt/JwtTokenValidator.java b/security/src/main/java/uk/gov/defra/tracesx/common/security/jwt/JwtTokenValidator.java index e3786e3..d60df87 100644 --- a/security/src/main/java/uk/gov/defra/tracesx/common/security/jwt/JwtTokenValidator.java +++ b/security/src/main/java/uk/gov/defra/tracesx/common/security/jwt/JwtTokenValidator.java @@ -102,7 +102,6 @@ private VerificationResult verifyClaims(JWTClaimsSet claims, KeyAndClaims keyAnd Set.of("exp")) .verify(claims, null); - LOGGER.info("JWT claims verified successfully."); return VerificationResult.SUCCESS; } catch (BadJWTException exception) { if (exception.getMessage().contains("issuer")) { diff --git a/version/pom.xml b/version/pom.xml index 6a74abc..41f3720 100644 --- a/version/pom.xml +++ b/version/pom.xml @@ -2,14 +2,14 @@ 4.0.0 - TracesX-SpringBoot-Common-Version - 4.0.19-SNAPSHOT + tracesx-springboot-common-version + 4.0.26-SNAPSHOT version uk.gov.defra.tracesx - TracesX-SpringBoot-Common - 4.0.19-SNAPSHOT + tracesx-springboot-common + 4.0.26-SNAPSHOT