0

I'm currently working on a java project. I already built the JAR for the project, and this JAR uses some properties files that have credentials for third party services in them. So this program reads the configuration files from "src/main/resources". But I don't think this is the best way to bring it to production since the properties files have credentials.

My question is, what is the state of the art to deploy a JAR to production server that reads properties files that have credentials in them?

  1. Do I just put the properties files in "src/main/resources" like I did and it's enough? Is it safe enough?
  2. Or should I not actually push the properties files with credentials in production and there is a better way to do that?

directory

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
  • Hello and welcome. About your deadline that you mentioned in your original question, please read [this](https://meta.stackoverflow.com/questions/326569/under-what-circumstances-may-i-add-urgent-or-other-similar-phrases-to-my-quest) – Federico klez Culloca Oct 07 '21 at 10:09
  • Anyway, you should [edit] your question to include the results of your research and why they don't fit your situation. For example, why can't you use [Spring Cloud Config](https://cloud.spring.io/spring-cloud-config/reference/html/) or [Vault](https://www.vaultproject.io/)? – Federico klez Culloca Oct 07 '21 at 10:15
  • I've found what i've been looking for, thanks for the input! – thisisnotrealname Oct 07 '21 at 19:07

1 Answers1

0

You can manage many configurations on spring-boot for each enviromment ( local, prd, hom, test... )

check this https://stackoverflow.com/a/68012400/7505687

Or you can work on each vars in .proporties overriding all values as your PRD enviromment vars are added.

eg. in application.properties

var.same-config-on-proporties=${ENV_VALUE_FROM_ENVIROMMENT:default-value-if-not-passed-from-env}

Dilermando Lima
  • 1,004
  • 8
  • 21