concept UAT in category gradle

This is an excerpt from Manning's book Gradle in Action - corrected 9052019.
Before an application can be deployed to a target environment—for example, a UAT (user acceptance test)—for manual testing by the QA team, or to production to give it into the hands of the end users, the deliverable, also called the deployable artifact, has to be built. It’s not uncommon for teams to rebuild this deliverable for each environment individually. This practice is often based on the fact that they need to include environment-specific configuration; for example, to point to a dedicated database set up for that environment. While this approach works, it creates the unnecessary risk of introducing a difference to the deliverable. For example, the dependency manager may pick a newer version of a third-party library that became available on a repository that you didn’t intend to include. To avoid any side effects, you should only build your deliverable once and store it in a central location. As you learned earlier, a binary repository is the perfect fit for this use case.
If you want to use the same code for deploying to all of these environments, you’ll need to be able to dynamically target each one of them at build time. Naturally, the test, UAT, and production environments run on different servers with potentially different ports and credentials. You could store the configuration as extra properties in your build script, but that would quickly convolute the logic of the file. Alternatively, you could store this information in a gradle.properties file. In both cases, you’d end up with a fairly unstructured list of properties. At build time, you’d have to pick a set of properties based on a naming convention. Doesn’t sound very flexible, does it? There’s a better way of storing and reading this configuration with the help of a standard Groovy feature.