Skip to content

Needless spring-cloud-starter-bootstrap dependency in module log4j-spring-cloud-config-client #2157

Closed
@raffig

Description

@raffig

Module log4j-spring-cloud-config-client has dependency to spring-cloud-starter-bootstrap which in general provides support for legacy bootstrap way of connecting to Config Server:
https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#config-first-bootstrap

I haven't made any research on this but at first sight it seems that this dependency is needless or at least should be an optional.

Side effect of this dependency as compile scoped is that application with dependency to log4j-spring-cloud-config-client always tries to connect to http://localhost:8888 at startup and then to the actually configured url with property spring.config.import as described in:

spring-cloud/spring-cloud-config#2052

Current solution is to exclude this dependency:

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-spring-cloud-config-client</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-starter-bootstrap</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

However maybe it would be possible to remove this dependency at all or at least change it to optional if some features requires it.

I have checked this with Spring Boot 3.2.1 and latest available Spring Cloud 2023.0.0 which resulted with log4j-spring-cloud-config-client version 2.19.0, however even the latest 2.22.1 has this dependency:

https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-spring-cloud-config-client/2.22.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions