Stackoverflow material

Spring Boot Externalising properties not working

If you can't see the link to the project file, subscribe to our mailing list to get free, instant access!

Premium Content Locked!

Enter your details below to instantly
reveal the premium content

Instructions

  1. Unzip the file under your working folder
  2. Open the command prompt and build it with mvn clean install
  3. ​Deploy the WAR to your Tomcat servlet container
  4. Startup Tomcat with either JAVA_OPTS="-Dspring.profiles.active=dev" or JAVA_OPTS="-Dspring.profiles.active=prod"
  5. Once the application has started up, browse localhost:8080 (or whatever port and context you have defined for your application). An index page will be shown to you
  6. If you have run with the dev profile you will see in the console output the String 2943 [http-nio-8080-exec-2] INFO com.example.IndexController - Webmaster email: me@dev.com
  7. If you have run with the prod profile you will see the output 2943 [http-nio-8080-exec-2] INFO com.example.IndexController - Webmaster email: me@prod.com
  8. Alternatively you can use your IDE to run the application in Tomcat. I'm using IntelliJ and I have set up the following VM argument: -Dspring.profiles.active=dev (or prod)

Spring Security Thymeleaf static resources don't load

If you can't see the link to the project file, subscribe to our mailing list to get free, instant access!

Premium Content Locked!

Enter your details below to instantly
reveal the premium content

Privacy Policy
Terms of Use
Disclaimer
Antispam
Amazon Affiliate
Affiliate Disclosure
FB Policy