0

I have multi modules app whera I wrote some library. I have properties there, and it comes from parent-app. My library service looks like that:

@Slf4j
@Service
public class SmsMessageService {

    @Value("${smsservice.oauth-token}")
    private String OAUTH_TOKEN;
    @Value("${smsservice.proxy-address:https://api.smsapi.pl/}")
    private String PROXY_ADDRESS;
    }

Parent-app bootstraps properties from config-server and bootstrap file is just:

spring:
  application:
    name: parent-app
  profiles:
    active: ${SPRING_PROFILES_ACTIVE:dev}
  cloud:
    config:
      uri: ${SPRING_CONFIG_URI:http://localhost:8888}
      fail-fast: true

I add my child library to parent app like this:

<dependency>
            <groupId>child-lib</groupId>
            <artifactId>child-lib</artifactId>
        </dependency>

And everything looks nice, dependency is injected but when i try to use it, it appears I do not have my properties, Spring could not find it. I tried to add @RefreshScope, @PropertySource, nothing works Please, help me :)

danny
  • 4,337
  • 3
  • 9
  • 10
  • Code you share doesn't looks same please share relavent keys class and pom files – Syed Mehtab Hassan Mar 28 '23 at 17:29
  • @SyedMehtabHassan finally i found the same problem on Sof: https://stackoverflow.com/questions/47890000/injecting-properties-in-spring-library . Looks like it is nothing I can do... – danny Mar 28 '23 at 21:03

0 Answers0