dependency-conflict-resolver
Dependency Conflict Resolver
Source mapping: Tier 2 high-value skill derived from Kotlin_Spring_Developer_Pipeline.md (SK-05).
Mission
Find which artifact version actually wins, why it wins, and what the narrowest safe correction is. Treat dependency conflict resolution as a version-authority problem, not a guessing contest.
Read First
./gradlew dependenciesor module-scoped dependencies output../gradlew dependencyInsight --dependency <artifact>for the failing library family.- Root and module build files, version catalogs, imported BOMs, and plugin versions.
- The exact runtime or compile-time error:
NoSuchMethodErrorClassNotFoundExceptionNoClassDefFoundErrorAbstractMethodError- duplicate binding warnings
Diagnose In This Order
- Identify the failing class or method owner.
- Identify which artifact provides that class.
- Identify all candidate versions on the graph.
- Identify the winning version and why it won:
- direct dependency
- BOM or platform
- version catalog alias
- transitive dependency
- conflict resolution rule
- Identify the true version authority that should own the family.
Advanced Classpath Traps
- A compile-time green build and a runtime linkage error usually means binary incompatibility between resolved artifacts, not a missing import.
- Jackson, Netty, SLF4J, Logback, Kotlin stdlib, and Hibernate families should usually be version-aligned as families, not patched one artifact at a time.
- Plugin classpath and application classpath are different worlds. A plugin upgrade may not fix a runtime library conflict and vice versa.
- Test runtime can differ from main runtime. A conflict that appears only in tests may come from test fixtures, mock libraries, or test containers support.
enforcedPlatform,strictly, and exclusions can fix a conflict or silently lock the graph into brittle behavior. Use them deliberately.- Multiple logging bindings often create confusing startup behavior long before they fail hard.
- Shading or relocation is rarely the first answer in an ordinary Spring Boot app. Reach for it only when classpath isolation is truly required.
Gradle Resolution Nuances
- Variant-aware resolution can choose artifacts by attributes such as usage, JVM version, and capabilities. A "present" dependency may still resolve to the wrong variant.
- BOM import order and multiple platforms can subtly change which family wins even when the declared versions look reasonable.
apiversusimplementationleakage in shared modules can make conflicts appear only in downstream consumers.- Duplicate classes from repackaged or relocated jars may not surface until runtime classloading or auto-configuration scans.
- Annotation processors, KSP, and plugin classpaths may need separate alignment from the main application runtime.
Expert Heuristics
- If the symptom is runtime-only, inspect the packaged artifact or runtime classpath, not only IDE dependency trees.
- If a library family is managed by Spring Boot, prefer returning ownership to the BOM over adding more local pins.
- If the same conflict recurs across modules, solve it at the platform or convention level instead of patching one module at a time.
- If a dependency looks unused, verify reflective, auto-configured, or service-loader usage before removing it.
Preferred Resolution Strategy
- Prefer removing an unnecessary explicit version when the BOM already manages a compatible one.
- Prefer aligning the entire affected dependency family.
- Prefer a direct, documented version override over hidden exclusions if an override is truly needed.
- Use exclusions only when a dependency is genuinely wrong for the module, not merely inconvenient.
- Explain why the chosen layer should own the version so the conflict does not return on the next upgrade.
Output Contract
Return these sections:
Conflict summary: what is colliding and where the symptom appears.Winning path: how the resolved artifact version is selected.Version authority: which file or platform should own the fix.Minimal fix: the smallest safe dependency or platform change.Verification: compile-time and runtime checks that confirm the graph is healthy.
Guardrails
- Do not invent version numbers without tracing the existing compatibility model.
- Do not spray exclusions until the graph goes green.
- Do not use
forceas the default answer. - Do not fix only the visibly failing artifact when the whole library family is misaligned.
Quality Bar
A good run of this skill explains the conflict path and resolves it at the right authority layer. A bad run produces a one-off version pin that compiles today and recreates the same conflict in the next branch.
More from jetbrains/skills
spring-kotlin-code-review
Review Kotlin + Spring changes for behavioral regressions, transaction and proxy bugs, API and serialization mistakes, persistence risks, security issues, configuration drift, and missing tests. Use when reviewing a PR, diff, patch, or design change where generic style-focused review would miss Spring-specific correctness and operational risks.
4doc
Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.
3kotlin-spring-proxy-compatibility
Diagnose and prevent Kotlin plus Spring proxy failures around `@Transactional`, `@Cacheable`, `@Async`, method security, retry, configuration proxies, and JPA entity requirements. Use when AOP annotations appear to do nothing, transactional or cache behavior is inconsistent, compiler plugins may be missing, self-invocation is suspected, or Kotlin final-by-default semantics may break Spring behavior.
3ci-cd-containerization-advisor
Design reproducible build, image, and deployment pipelines for Kotlin plus Spring applications, including CI verification, layered containers, rollout safety, and deployment-time migration coordination. Use when creating or improving Dockerfiles, CI workflows, image hardening, Kubernetes manifests, release gates, or deployment strategies for Spring Boot services, especially where build reproducibility and operational safety matter.
3kotlin-idiomatic-refactorer-spring-aware
Refactor Kotlin code toward clearer, more idiomatic design without breaking Spring behavior, serialization, persistence, or public contracts. Use when Java-flavored Kotlin needs cleanup, domain modeling should become more expressive, or boilerplate should be reduced, but the refactoring must remain safe for proxies, Jackson, JPA, configuration binding, and existing tests.
3configuration-properties-profiles-kotlin-safe
Design and diagnose Spring configuration, profiles, and `@ConfigurationProperties` binding for Kotlin applications. Use when property binding fails, environment-specific overrides behave unexpectedly, profile layering is confusing, secrets or defaults are modeled unsafely, or Kotlin nullability and constructor binding semantics make configuration errors hard to detect.
3