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
0
votes
2 answers

Set Spring profile in Tomcat web app with no web.xml file

I have a webapp that is a RestEASY JAX-RS application and that uses the latest servlet specifications, such as Java EE annotations so that I don't need to create a web.xml file. The webapp is bundled as foobar.war and dumped into the webapps…
Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
0
votes
0 answers

Spring Boot Profile Switch Real or Mock API

I have application.yml spring.active.profile=default,dev api-url: http://dev-api.com I have another file application-mock.yml which has below api-url related to wiremock. application-mock.yml api-url: http://localhost:7845 I have…
user2057006
  • 617
  • 4
  • 15
  • 28
0
votes
0 answers

Disable profile specific property when other profile is active

I am looking for a way to disable some property (use it default value) when 2 profiles are used in conjunction. My setup includes 3 profiles: dev, prod & debug. The application.yml: spring: profiles: active: dev . . . --- spring: profiles:…
Maxim Kirilov
  • 2,639
  • 24
  • 49
0
votes
1 answer

Start springboot with profiles

One of our developers left the team few months ago and, due the short notice we was not able to complete the KT. So, now, I have a project I cannot start (of course is the less used component but, today, of course, has become critical, you know…
Andrea Girardi
  • 4,337
  • 13
  • 69
  • 98
0
votes
1 answer

Injecting specific bean to DAO using Spring profile

In my webapplication there are two datasource beans in the applicationContext one is to be used for real-env and one is to be used for execution of test. The dataSource objects is injected in one DAO class. Using Spring profile how can I configure…
0
votes
1 answer

How to make Spring Boot skipping some configurations

I have a Spring-Boot project which works with DB-connections and a lot of other stuff. Now I added another "main-class" to the project. The thing is: by starting this class, all configuration settings (which come from application.yml) are loaded.…
CodeCannibal
  • 324
  • 6
  • 21
0
votes
0 answers

Multiple Spring profiles for xml properties files?

Im wanting to feed multiple configuration files based on properties into – classpath:properties/local.properties
farrellmr
  • 1,815
  • 2
  • 15
  • 26
0
votes
3 answers

Spring Profile values getting mixed

I'm using Spring Boot 1.4.3.RELEASE and gradle 2.13 for developing an api. On local environment, 'local' profile is working perfectly, but I'm getting issue while deploying code in Linux/Unix server. Here is my application.yml with two profiles :…
Yogen Rai
  • 2,961
  • 3
  • 25
  • 37
0
votes
1 answer

@ActiveProfile("integration-test") in SpringBoot test not resolving

I have an integration test with the following configuration: @RunWith(SpringJUnit4ClassRunner.class) @ActiveProfiles("integration-test") @ContextConfiguration(classes = { PersistenceJpaConfig.class, ContextConfig.class, ServiceConfig.class,…
John Stafford
  • 565
  • 2
  • 9
  • 29
0
votes
1 answer

How to configure different data sources for local testing and deployment in Spring Boot Application

I am trying to find the best way to configure my Spring Boot Web application to easily switching between the following data sources for both local testing and deployment. H2 in memory db. Local testing only. Dev oracle. Local testing and…
ddd
  • 4,665
  • 14
  • 69
  • 125
0
votes
0 answers

spring boot application-[profile].properties is not working

I have setup spring boot web project. It works well when I have only one application.properties file with all my database connection details. I am using mysql database. This is my application.properties…
vishal
  • 3,993
  • 14
  • 59
  • 102
0
votes
0 answers

How can I automatically switch to a Spring profile to another one during the execution of an application? (to change the DB on which a DAO work)

I am working on a batch application developed using Spring. This application have to read on a database and then have to write on another database. So I know that I can create 2 different DAO with 2 different connections but I am trying to do it…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
0
votes
0 answers

Spring profiles validate if supplied active profile is available

I am using spring profiles to manage different set of beans. The active profile is set programmatically overriding org.springframework.context.ApplicationContextInitializer.initialize() and…
cooltoad
  • 171
  • 2
  • 12
0
votes
0 answers

Is it possible to pass over Spring profiles to Spring submodules?

I have a Spring Boot application with Spring submodules as dependencies. I start the application using Spring Boot Maven Plugin like this: mvn spring-boot:run -Drun.profiles=foo,bar For me it seems like the submodules don't receive the active…
Farkas István
  • 504
  • 2
  • 5
  • 15
0
votes
0 answers

Spring XML config not able to retrieve active profile

The application I am working on has an XML-based Spring configuration(framework version: 4.1.7.RELEASE). Because I want to instantiate certain beans provided a profile is specified, I have added the following to my web.xml:
Cristina_eGold
  • 1,463
  • 2
  • 22
  • 41