Exclude logback-classic from generate-configprops plugin dependency - #686
Merged
Merged
Conversation
1 task
spring-cloud-build-docs is consumed via the jar-with-dependencies classifier, which already bundles a matched logback-classic/ logback-core pair. exec-maven-plugin's includePluginDependencies classpath merge also separately resolves the dependency's own unversioned logback-classic, landing an old, incompatible logback-classic/logback-core split across the uber jar and the separately-resolved thin jar. Depending on classpath ordering this intermittently fails generate-configprops with: java.lang.NoSuchMethodError: 'java.lang.ClassLoader ch.qos.logback.core.util.Loader.systemClassloaderIfNull(java.lang.ClassLoader)' Excluding logback-classic (and transitively logback-core) forces the classpath to rely solely on the bundled, self-consistent pair.
ryanjbaxter
force-pushed
the
fix/generate-configprops-logback-conflict
branch
from
September 17, 2026 20:25
10dfe2c to
9ee76b6
Compare
ryanjbaxter
added a commit
that referenced
this pull request
Sep 17, 2026
spring-cloud-build-docs is consumed via the jar-with-dependencies classifier, which already bundles a matched logback-classic/ logback-core pair. exec-maven-plugin's includePluginDependencies classpath merge also separately resolves the dependency's own unversioned logback-classic, landing an old, incompatible logback-classic/logback-core split across the uber jar and the separately-resolved thin jar. Depending on classpath ordering this can intermittently fail generate-configprops with: java.lang.NoSuchMethodError: 'java.lang.ClassLoader ch.qos.logback.core.util.Loader.systemClassloaderIfNull(java.lang.ClassLoader)' Excluding logback-classic (and transitively logback-core) forces the classpath to rely solely on the bundled, self-consistent pair. Same fix as #686 on 5.0.x, applied here preemptively since main has the identical fragile setup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes intermittent/reproducible failures of the
generate-configpropsexec-maven-pluginexecution in downstream projects (e.g.spring-cloud-config's5.0.xCI: https://github.com/spring-cloud/spring-cloud-config/actions/runs/35267039454/job/105356701618):spring-cloud-build-docsis consumed by this execution via thejar-with-dependenciesclassifier — a shaded uber jar that already bundles its own, self-consistentlogback-classic/logback-corepair. However,exec-maven-plugin'sincludePluginDependenciesclasspath merge also separately resolves the dependency's own unversionedlogback-classic(which lands on an old, incompatible version), adding a second, conflicting copy of these classes to the classpath. Which copy actually gets loaded for which class depends on classpath ordering, which isn't guaranteed stable across builds — hence the intermittent nature of the failure.Verified by disassembling the actual jars from a failing CI run: the uber jar's bundled
Loaderclass hassystemClassloaderIfNull, but the separately-resolved standalonelogback-core(an old version) does not, while the separately-resolvedlogback-classic'sContextInitializerdoesn't call it at all — confirming two mismatched copies were present on the classpath.Fix
Exclude
ch.qos.logback:logback-classic(which transitively pullslogback-core) from thespring-cloud-build-docsplugin dependency declaration in thegenerate-configpropsexecution, so the classpath relies solely on the matched pair already bundled in the uber jar.Test plan
spring-cloud-config's5.0.xCI job (which triggered this investigation) is rerun against the updatedspring-cloud-buildsnapshot and passes thegenerate-configpropsstep consistently