From f2aef34f5adfa73c0f64fe49df4b57f04d07b913 Mon Sep 17 00:00:00 2001 From: Andreas Svanberg Date: Wed, 12 Feb 2025 13:09:06 +0100 Subject: [PATCH] Fix Docker build due to missing json-smart version Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.8.1:go-offline (default-cli) on project war: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-oauth2-client:jar:3.4.1 -> org.springframework.security:spring-security-oauth2-client:jar:6.4.2 -> com.nimbusds:oauth2-oidc-sdk:jar:9.43.4 -> net.minidev:json-smart:jar:[1.3.3,2.4.10]: No versions available for net.minidev:json-smart:jar:[1.3.3,2.4.10] within specified range With the release 2.5.2 of net.minidev:json-smart the Maven metadata at https://repo1.maven.org/maven2/net/minidev/json-smart/maven-metadata.xml only include the absolute newest version. Compare with the old cached version at https://web.archive.org/web/20240212064759if_/https://repo.maven.apache.org/maven2/net/minidev/json-smart/maven-metadata.xml. This causes issues for Maven's dependency plugin go-offline goal which, for some reason, ignores any dependency version upgrades in and only checks for what's written in the pom.xml of com.nimbus:oauth2-oidc-sdk:9.43.4. Since that pom file requires a version in the range of 1.3.3 to 2.4.10 none of which are no longer available in the Maven metadata file the goal will fail. This change removes the dependency caching layer from the Docker build to get around this problem for now. It will slow down Docker builds, but it is what it is. References: * https://github.com/netplex/json-smart-v2/issues/240 * https://repo1.maven.org/maven2/net/minidev/json-smart/maven-metadata.xml * https://web.archive.org/web/20240212064759if_/https://repo.maven.apache.org/maven2/net/minidev/json-smart/maven-metadata.xml * https://repo1.maven.org/maven2/com/nimbusds/oauth2-oidc-sdk/9.43.4/oauth2-oidc-sdk-9.43.4.pom --- Dockerfile | 7 ------- war/pom.xml | 41 ----------------------------------------- 2 files changed, 48 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9212410a58..ac53fd07f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,6 @@ COPY view/pom.xml view/pom.xml COPY war/pom.xml war/pom.xml COPY daisy-integration/pom.xml daisy-integration/pom.xml -# Download dependencies in a separate layer to allow caching for future builds -RUN ./mvnw dependency:go-offline \ - --batch-mode \ - --define includeScope=compile \ - --activate-profiles docker-dependencies - COPY api/src/ api/src/ COPY core/src/ core/src/ COPY view/src/ view/src/ @@ -26,7 +20,6 @@ COPY war/src/ war/src/ COPY daisy-integration/src/ daisy-integration/src/ RUN ./mvnw package \ - --offline \ --define skipTests \ --activate-profiles branch,DEV \ --define skip.npm \ diff --git a/war/pom.xml b/war/pom.xml index 19e7317b23..c1dd889587 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -140,46 +140,5 @@ branch - - docker-dependencies - - - - org.jboss.logging - jboss-logging - - - com.fasterxml - classmate - - - net.bytebuddy - byte-buddy-agent - - - com.querydsl - querydsl-apt - ${querydsl.version} - jakarta - - - org.assertj - assertj-core - test - - - net.minidev - json-smart - - - org.hamcrest - hamcrest-core - test - - - -- 2.39.5