Video in progress
In a multi-service system, how do you manage library versions, their conflicts and security vulnerabilities (CVEs)?
I manage versions centrally through a BOM, turn updates into a steady stream with automatic PRs (Renovate/Dependabot), and a vulnerability scanner in CI blocks critical CVEs. With an SBOM I can quickly find which service has which library. The goal is constant small upgrades instead of a "big upgrade".
📖 Answer
-
Centralize: the Spring Boot BOM + the company platform BOM (internal libraries and extra versions), a Gradle version catalog or a Maven parent. A service changes a library version only for a serious reason.
-
Conflicts. When transitive dependencies bring in different versions, you need to know which one wins:
mvn dependency:tree,gradle dependencyInsight. ANoSuchMethodErrororClassNotFoundExceptionat runtime is often exactly a version conflict. Maven Enforcer'sdependencyConvergenceor Gradle'sfailOnVersionConflictshows the conflict at build time. -
Automatic updates. Renovate opens a PR every week; patch and minor updates auto-merge if the tests pass, while majors are grouped and handled by hand. If the tests aren't reliable, automatic updates don't work, which is one more reason to invest in test quality.
-
Vulnerabilities. A scanner in CI for container images and jars (Trivy, OWASP Dependency-Check, Snyk). The policy: a critical vulnerability stops the build, and an exception is only temporary and comes with a reason. Generate and keep an SBOM (CycloneDX) for every build: in a case like Log4Shell you can answer "which services have it?" in minutes.
-
Measure: how many versions behind services are on average, the number of open critical CVEs and the time to close them. These numbers show the health of the platform.
Sign up to mark studied questions and save your progress.