@@ -53,7 +53,14 @@ dependencies {
5353 api " org.apache.httpcomponents.client5:httpclient5:${ versions.httpclient5} "
5454 api " org.apache.httpcomponents.core5:httpcore5:${ versions.httpcore5} "
5555 api " org.apache.httpcomponents.core5:httpcore5-h2:${ versions.httpcore5} "
56- runtimeOnly " org.slf4j:slf4j-api:${ versions.slf4j} "
56+
57+ // Ideally this would be `runtimeOnly` so that we don't accidentally write code against the SLF4j API
58+ // However, some child plugins (like security) need to use slf4j directly in order to manage logging for their dependencies :(
59+ // And due to the way our plugin loading handles java modules between dependent plugins, this plugin (x-pack-core) needs to declare
60+ // a module dependency on slf4j (`requires org.slf4j`) so that security can also be dependent on it
61+ // And having a module dependency counts as using the jar, so we can't make it `runtimeOnly` :(
62+
63+ implementation " org.slf4j:slf4j-api:${ versions.slf4j} "
5764 runtimeOnly " org.apache.logging.log4j:log4j-slf4j-impl:${ versions.log4j} "
5865
5966 api " commons-logging:commons-logging:${ versions.commonslogging} "
@@ -71,9 +78,6 @@ dependencies {
7178 implementation project(" :x-pack:plugin:core:template-resources" )
7279
7380 testImplementation " org.elasticsearch:mocksocket:${ versions.mocksocket} "
74- testImplementation " org.apache.logging.log4j:log4j-slf4j-impl:${ versions.log4j} "
75- // this might suffer from https://github.com/elastic/elasticsearch/issues/93714
76- testImplementation " org.slf4j:slf4j-api:${ versions.slf4j} "
7781 testImplementation project(path : ' :modules:reindex' )
7882 testImplementation project(path : ' :modules:parent-join' )
7983 testImplementation project(path : ' :modules:lang-mustache' )
0 commit comments