Exclude logback-classic from generate-configprops plugin dependency

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.
This commit is contained in:
Ryan Baxter
2026-09-17 16:25:42 -04:00
parent 213259f0e3
commit 9ee76b6f41
+14
View File
@@ -1248,6 +1248,20 @@
</version>
<classifier>${spring-cloud-build-docs-classifier}</classifier>
<type>jar</type>
<!-- The jar-with-dependencies classifier above already bundles a
matched logback-classic/logback-core pair. Without this
exclusion, exec-maven-plugin's includePluginDependencies
classpath merge also resolves spring-cloud-build-docs' own
unversioned logback-classic dependency separately, landing an
old, incompatible logback-classic/logback-core split across the
two jars and failing with a NoSuchMethodError depending on
classpath ordering. -->
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<configuration>