Questions tagged [spring-properties]

166 questions
0
votes
0 answers

Spring Boot & WebClient - how to add additional headers using @ConditionalOnProperty to a specific WebClient instance?

I have a service that is holding an WebClient instance: @Service @Getter public class SomeApiWebClient { private final WebClient webClient; private final String someApiUrl; public SomeApiWebClient(@Value("${some.api.url}") String…
hc0re
  • 1,806
  • 2
  • 26
  • 61
0
votes
2 answers

Loading Spring-boot properties to POJO

I have properties like this: credentials: userid: password: I have a POJO: @Setter public class Credentials { private String userid; private String password; However, this POJO is in another jar, so I can't add…
Peter Kronenberg
  • 878
  • 10
  • 32
0
votes
0 answers

Jndi ldap log4j vulneraility

As the entire world know that the log4j vulnerability involves jndi ldap lookup attack. There cpuld be many other libraries using jndi ldap lookup for property resolutions. What is the possibilty people? Like Spring Property placeholder…
Pankaj Shet
  • 179
  • 2
  • 8
0
votes
1 answer

Profile specific logging in Spring Boot

We have a spring boot application using log4j2. We want to use different log levels for different profiles. After lot of struggles, I found out that this is not possible with log4j2 but it is possible with logback. I don't want to use logback…
0
votes
0 answers

Kubernetes Configmap data format

I'm writing a K8s configmap for my Spring Boot application. This is my application.yaml file: app: config: paths: - id: a uri: http://localhost:8080 args: - x=1 - y=2 - id: b …
0
votes
0 answers

Not able to find the .properties file from the jar using spring boot gradle

Not able to find the sensitive .properties file path, when I run the jar, but from IDE it is executing, using Gradle. sensitive. properties is in the resources folder public void getConfigValue(String configKey) { Resource resource = new…
Girish
  • 2,196
  • 2
  • 18
  • 24
0
votes
1 answer

How to read properties in its own when importing spring application jar into another application

I have two spring application let say application_a and application_b, My application_b is dependent on application_a. I created jar of first application using mvn package and added its jar to my local maven .m2/repository, and added its dependancy…
Afsar edrisy
  • 1,985
  • 12
  • 28
0
votes
1 answer

In Spring is it good practice to put custom properties into the default application.properties/yaml file?

I have a Spring Boot application. I want to add some custom properties. Is it good practice to put these properties into the default application.properties/application.yaml file? Or is it better to put them in a new properties file and keep only…
Harold L. Brown
  • 8,423
  • 11
  • 57
  • 109
0
votes
1 answer

Spring cloud config server for multiple stage

I'm working with spring cloud config server, and my need is to create a configuration file for each stage prod test and dev, I already created 4 yml file application.yml for the default profile, application-{profiles} for each profile, so my…
0
votes
1 answer

Gradle String Boot multi-projects, expand application.properties

I'm using gradle to manage a multi-modules spring boot project. ->Root ---> module-1 --------->src/main/java --------->src/test/java/application.properties ---> module-2 --------->src/main/java --------->src/test/java/application.properties --->…
flywell
  • 384
  • 3
  • 20
0
votes
1 answer

Spring Boot Property file precedence

In my Spring Boot program I'm getting a failure due to a bad property value on load. In particular, it uses the DB2 hibernate dialect but it's not defined in the property file I thought I was using. Assuming no annotations, where does Spring look…
Woodsman
  • 901
  • 21
  • 61
0
votes
1 answer

Is there a way to make IntelliJ autocomplete custom-named property files?

I have a custom-named property file inside a library, e.g. foo.properties which I then load in a configuration class, like so: @Configuration @PropertySource({"/foo.properties"}) public class FooConfiguration {} IntelliJ doesn't recognise…
Dimitrios K.
  • 1,008
  • 13
  • 36
0
votes
1 answer

How can use ConfigDataEnvironmentPostProcessor and spring.profiles.group?

I'm using Spring Boot 2.4.2 and tried to use spring.profiles.group in my property files like: application.yaml spring: profiles: group: local: core application-core.yaml --- spring: config: activate: on-profile:…
심시은
  • 339
  • 1
  • 5
  • 21
0
votes
0 answers

Spring: Can't override properties with @ConfigurationProperties for test

I'm trying to configure property for test, using @ConfigurationProperties. My config-class with properties: @Data @Configuration @ConfigurationProperties(prefix = "data") public class TestFileSettings { private String…
Jelly
  • 972
  • 1
  • 17
  • 40
0
votes
1 answer

How to pass spring.datasource.data from docker as full path?

This is my docker-compose.yml file. version: '3' services: backend-service: build: ./backend-service volumes: - ./backend-service/database:/usr/lib/h2 ports: - 8080:8080 environment: -…
Lorthiz
  • 55
  • 1
  • 10