Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

424
Visualizações
Spring Boot doesn't resolve property placeholder in yaml for apring.profiles.active property

I am used to feature that I can refer to another property from within .yml file using ${...}. So I have Spring Boot v2.3.0.RELEASE and following .yml:

env: dev
spring:
  profiles:
    active: ${env}

But unfortunately, when running my application i see

The following profiles are active: ${env}

Despite the fact that this placeholder works perfectly in other properties, for example kafka topics i define as

topic: ${env}.topic_name

and i can see in logs that it's resolved properly

Kafka producer topic=dev.topi_name

Seems like spring.profiles.active is some sort of an exception from this rule, but i can't find why. And how can i get the same result (with profile depending on other property variable) as is, without env variables, external keys, setting in code, etc. ?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This problem has been fixed in Spring Boot 2.4.0 as a part of the updated config file processing (more about it in 2.4.0 release notes).

If interested, you can play with the new property spring.config.use-legacy-processing to see the difference in how spring.profiles.active is processed.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda