./gradlew bootRun only dependencies

tl;dr build.gradle: ... configurations { bootRunOnly } depencencies { ... bootRunOnly group: 'org.bouncycastle', name: 'bc-fips', version: '2.0.0' bootRunOnly group: 'org.bouncycastle', name: 'bcpkix-fips', version: '2.0.7' } bootRun { classpath = sourceSets.main.runtimeClasspath + configurations.bootRunOnly } Background We’ve got a project requiring FIPS compliant crypto, so, instead of having to wrangle java.secrity files and the related JARs on each project, we created a base image that contains these depencencies. However, we still need to be able to run the projects locally (not necessarially in FIPS mode), but we don’t want any conflicting JARs to end up in the final Immage. ...

November 8, 2024 · Nigel Sim