Skip to content

nsdiv/spring-boot-java8-java7-prop-loading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Found a bug in spring boot. The precedence of loading the profiles is reversed when I switch between JAVA 7 and JAVA 8. Reference to git issue - spring-projects/spring-boot#4111

Steps to reproduce

  • set JAVA_HOME to java 1.7 (I'm using 1.7.0_67)
  • run mvn clean install. Tests pass.
  • set JAVA_HOME to java 1.8 (I'm using 1.8.0_60)
  • run mvn clean install. Tests fail.

Description of Issue

There are two profiles that are loaded - default and test.

Here is the application.yml file

spring:
  profiles: default

rest:
  connectionTimeoutMillis: 20000
  readTimeoutMillis: 60000
  maxConnectionsPerHost: 25
  maxTotalConnections: 25
  httpProxyEnabled: false
  httpProxyHost: localhost
  httpProxyPort: 8888
---
spring:
  profiles: test

rest:
  connectionTimeoutMillis: 30000

Followed by an override file application-test.properties

rest.connectionTimeoutMillis: 40000

While running JAVA 7, the value for rest.connectionTimeoutMillis comes as 40000. When you switch to JAVA 8, the value comes out as 30000.

About

Issue between Java 8 and Java 7. Properties files loading precedence

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages