我想在application.properties
中为build.gradle
创建变量。
示例:
我想创建一个变量spring.datasource.username
,并在"build.gradle"
文件中为其分配一个值。此变量应添加到application.properties
文件中。
有人可以帮我吗?
我尝试过:
ext{
spring.datasource.username = username
spring.datasource.password = password
}
预期结果:应在application.properties文件中创建变量 出现错误:
“无法为类型为org.gradle.internal.extensibility.DefaultExtraPropertiesExtension的对象获取未知属性'spring'”