There is a Java project, build is done using Gradle. There are tests in the project that also check the work with the database.

There is a hibernate.xml file in which the settings for the database. How to make so that the parameters to the database login / password / server could be set via the command line gradle build?

  • `-Pmyprop = myvalue` not suitable? - Senior Pomidor
  • And instead of hibernate, set $ {myprop}? - Andrew Cherepanov
  • not really. prescribe $ {myprop}, if $ {myprop} is not, then prescribe default value - Senior Pomidor
  • A line from hibernate: <property name = "hibernate.connection.username"> $ {my_user} </ property> I run with the option -Pmy_user = test_user does not swallow it, in the mode of Debug I see that it tries to connect to the database without a user. What is wrong do not tell? - Andrew Cherepanov

0