Questions tagged [spring-profiles]

Spring Profiles provide a way to segregate parts of an application configuration and make it only available in certain environments.

Spring Profiles provide a way to segregate parts of an application configuration and make it only available in certain environments.

http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html

349 questions
3
votes
0 answers

How can I implement something similar to spring profiles when using Simple Injector IOC container in C#

After some time in Java with Spring, I'm trying to take all of IOC principles into some old and new C# Code, I've started using simple injector after reading some comparisons. I need different profiles in order to load different objects to my…
3
votes
2 answers

Execute ApplciationRunner run only in dev profile

How do I create dummy data when the application starts only in dev profile? I'm following this article to work with profiles in spring boot. I need to create dummy data when the application starts, but only in the dev profile. How do I achieve this?…
Kshitij Bajracharya
  • 811
  • 2
  • 14
  • 37
3
votes
3 answers

Spring Expression Language - set different value if Profile is set

I have a class like this: public AbstractConfig() { super(DataConfig.MGR_NAME); } Inside DataConfig there is: public final String MGR_NAME = "theManager"; I find SpEL documentation confusing. Is there a way I can change a value if a…
JoeG
  • 7,191
  • 10
  • 60
  • 105
3
votes
2 answers

Spring Boot Profile-specific Properties build using Maven Configuration

How to build the environment specific war file for a spring boot application using maven.I have created 3 profile configuration files placed in src/main/resource/ folder. application.prod.properties …
Sreenivas M
  • 157
  • 3
  • 13
3
votes
1 answer

Unable to generate different spring-cloud-gateway routes based on active Spring profile

I'm trying to define different routes in Spring Cloud Gateway using Spring profiles. Everything I've read about how Spring manages profiles using yaml sems to indicate it should work, but for the life of me it just ... doesn't seem to. (My other…
3
votes
1 answer

Set active spring profile with bootWar

I'm trying to set the active spring profile when building a WAR file. I'm building the WAR file with gradle bootWar I managed to find a solution that works for gradle bootRun -Pprofiles=prod bootRun { if (project.hasProperty('profiles')) { …
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124
3
votes
2 answers

Springboot profile and running some tests

On a springboot application I have unit and integration tests. What I want is to control which group of tests to run and when. I mean running units OR integration tests, BUT not both. I know it is possible through maven, but I was wondering if…
3
votes
1 answer

Spring Boot: Profiles ignored in PropertySourcesPlaceholderConfigurer loaded file

I have a library that is a Spring Boot project. The library has a library.yml file that contains dev and prod props for its configuration: library.yml --- spring: profiles: active: dev --- spring: profiles: dev env: dev --- spring: …
James
  • 2,876
  • 18
  • 72
  • 116
3
votes
0 answers

spring boot test loads all profiles

Hi I got a simple application and I try to write some integration tests. So I am using springboot in my JUnit Tests and I need slightly different configurations for test-development and production so I work with profiles. My problem now is that the…
Goldfish
  • 614
  • 1
  • 7
  • 19
3
votes
3 answers

Override property value from multiple spring active profile

I have a spring boot application that has application.yml. Contents of application.yml: spring: profiles: active: default,private integrations: ecom: api-url: http://localhost:8080/com Contents of application-private.yml: integrations: …
user2057006
  • 617
  • 4
  • 15
  • 28
3
votes
1 answer

Spring - Don't create bean if a primary bean is present

Is it possible to prevent the creation of a bean of type A if it could be generated as a primary bean Example: I have two configuration classes and have two profiles. AppConfig.java: (The generic configuration class having all…
Thiyagu
  • 17,362
  • 5
  • 42
  • 79
3
votes
1 answer

Are Spring Profiles and Spring Boot Profiles the same?

Here is description about Spring Boot profiles and here is Spring profile description. At first glance if it is needed to use profiles thay easy can be used without Spring Boot. So does spring boot provide addituonal profile functionality to spring…
Cherry
  • 31,309
  • 66
  • 224
  • 364
3
votes
1 answer

Spring boot ignores "ignoreUnresolvablePlaceholders" = true

I'm having a problem with my Spring Boot application ignoring my ignoreUnresolvablePlaceHolders set to true in my config.xml file. I have these options explicitly set: