Robert Elliot
03/20/2025, 1:34 PMdocker build . --no-cache
builds fine running RUN ./gradlew --no-watch-fs --stacktrace build
The same command outside docker fails as so:
* What went wrong:
Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
> Could not find com.fasterxml.jackson:jackson-bom:.
Required by:
project :
> Could not find com.fasterxml.jackson.module:jackson-module-kotlin:.
Required by:
project :
> Could not find com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-base:.
Required by:
project :
> Could not find com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider:.
Required by:
project :
> Could not find org.eclipse.jetty:jetty-bom:.
Required by:
project :
Now it's true that I do not provide versions for com.fasterxml.jackson:jackson-bom
or org.eclipse.jetty:jetty-bom
- the project is basically an enhancement of another dependency, which has versions for them, so I let it control those versions.
How is it possible that the same gradle version can resolve those dependencies in Docker, but not locally?
(I've tried disabling the build and configuration cache, same error.)Chris Lee
03/20/2025, 1:48 PMChris Lee
03/20/2025, 1:50 PMRobert Elliot
03/20/2025, 2:16 PMpossibly missing a property or other configuration that sets those versions?Not that I can see. Compared build scans, the only obvious difference is that in the scan from the docker build the dependency that defines those bom versions has them as dependencies, and in the scan from the local build it does not. But I don't understand why - I've even blown away my local
~/.gradle/caches
to force a redownload of that dependency, and of course in docker it gets downloaded every time. So the metadata should be the same - but clearly isn't.Chris Lee
03/20/2025, 2:17 PMRobert Elliot
03/20/2025, 2:19 PMmavenLocal()
repository. Removing it makes it pass. Great spot.Chris Lee
03/20/2025, 2:19 PMmavenLocal()
== janky behaviour.Robert Elliot
03/20/2025, 2:50 PM