1

I'm creating a custom spring boot starter which configures a bean from a different spring boot starter.

// my custom starter's build.gradle

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
}
// my-custom-starter's auto configuration

@Autoconfiguration
public class MyAutoconfiguration {

    @Bean
    public JwtDecoder jwtDecoder() {
        return ...
    }

}

In my testing, it seems like whoever imports my custom starter needs to also bring in spring-boot-starter-oauth2-client as a dependency if they want access to the JwtDecoder, unless I change it to an api dependency:

// my custom starter's build.gradle

dependencies {
    api 'org.springframework.boot:spring-boot-starter-oauth2-client'
}

Is this a bad practice, or would it cause issues in the future with conflicting dependencies?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.