cuba-platform / cuba-gradle-plugin

Gradle plugin for building CUBA platform and applications
https://www.cuba-platform.com
Apache License 2.0
15 stars 18 forks source link

Make generated properties explicit #143

Open belyaev-andrey opened 3 years ago

belyaev-andrey commented 3 years ago

Environment

Description of the bug or enhancement

When UberJar is generated for separate deploy, local.app.properties file is generated automatically. In this file, we can see some pre-defined properties that override $profile$-app.properties settings.

In order to change generated local.app.properties, you have to define "default" properties in the build.gradle file, so there is no point in creating profile file.

Example of the default local.app.properties for core:

cuba.logDir = ${app.home}/logs
cuba.confDir = ${app.home}/${cuba.webContextName}/conf
cuba.tempDir = ${app.home}/${cuba.webContextName}/temp
cuba.dataDir = ${app.home}/${cuba.webContextName}/work
cuba.dataSourceJndiName = jdbc/CubaDS
cuba.download.directories = ${cuba.tempDir};${cuba.logDir}
cuba.dbDir = web-inf:db
cuba.uberJar = true
cuba.doNotExposeRemoteServices = false
cuba.webPort = 8079

In this case, it is almost impossible to override the property cuba.webPort, you have to set it using command line, which is not great.

I'd suggest making these "default" properties explicit in the build task parameters and do not generate them at all if they are not specified in the task. Default values can be included in app.properties/web-app.properties though. Can be related to issue #135

andreysubbotin commented 3 years ago

This will require additional project migration in CUBA Studio. We will be able to do only when switching to 7.3 version.