jib
jib copied to clipboard
Usage of Spring boot Gradle configuration name
Spring Boot Gradle plugin has a special configuration developmentOnly which affects only development classpath
Currently:
-
JIB uses by default on
runtimeClasspathconfiguration - Jib has a special Gradle extension that seems (according to the documentation only covers "devtools") which is not enough
Spring defines a special Gradle configuration productionRuntimeClasspath, see this comment for example.
This misaligned use causes issues in the production classpath which is hard to catch locally:
- locally we expect these dependencies to exist
- Spring disables them in tests so tests won't catch them too
Hence, the only way to catch them is to deploy the application.
Example issues:
- Spring devtools are exposed in the container image classpath
- Docker compose from spring-boot-docker-compose will be in the container runtime classpath too which is not expected and might cause issues (I got this issue)
- tl;dr any dependency supposed to be used with
developmentOnlywill be exposed*
Proposal options:
- [Good option] Shall we, in case of Spring Boot apps, ("if spring boot") default it to
productionRuntimeClasspath? - [No the best option] Shall the extension switch the configuration to
productionRuntimeClasspath?
@artemptushkin can I work on this?
@manojks1999 Thank you for your interest, fine with me, I'm not a maintainer but I can review as I know the project a bit