Cuba project setting best practices

Hi, we are now using the great CUBA platform from a few months, everything is going really good but we have two little questions that, even looking for a solution, has not a good answer so far.

  1. how manage the project settings, like mysql localhost and other setting, when you have more than one developer working on a single project? I mean, every time a developer push the project to the version control, overwrites the previous values… so how to work with that?

  2. in somehow linked to the first question, how we can manage the dev, qa, prod envs? We found a few threads speaking about it but not an “official” solution to this problem…

Thank you very much!

1 Like


First of all, I have to ask, are you familiar with the IntelliJ IDEA’s concept of “VCS change lists”?
Personally in my practice when I alter contents of the file that I don’t want to commit back to version control, I create separate “dont commit” change list, put changed file to that list, and forget about the problem.

Second, in upcoming CUBA 7.2 there will be the option to store database connection properties in files. Connecting to Databases - CUBA Platform. Developer’s Manual

Overriding on the local machine such properties that are stored in the can be easier.
I would do the following:

  • create file “” near to the main file
  • put path to this file to the .gitignore configuration - so its contents will never be pushed to VCS
  • mention this new file in the appPropertiesConfig context parameter in the web.xml of the corresponding module, below main properties file. E.g.
    <!-- Application properties config files -->
  • put all developer-machine-local properties to the new file. All developers in the team will need to create and fill that file manually, because this file will not come to VCS.

In the upcoming CUBA 7.2 release notes you can find two new features to support dev/qa/prod separation:

  1. Spring profiles can be used to customize application in different environments.
  1. OS environment variables can be used as a source of application properties values.

Spring profiles are the direct solution - you can define dev/qa/prod-specific Bean implementations or assign qa/prod-specific application property files.

OS environment variables can be used to pass secret variables (database credentials) to the application in qa / prod environments.

@AlexBudarov, Thank you very much I will check out everything. Thanks for your time.